Browse Source

fix

merge-requests/18/head
vargburz 3 years ago
parent
commit
1e2f6b9f52
  1. 9
      src/index.ts
  2. 3
      src/models/options.ts

9
src/index.ts

@ -29,19 +29,11 @@ import { palette } from './colors';
import * as d3 from 'd3'; import * as d3 from 'd3';
import defaultsDeep from 'lodash/defaultsDeep';
import includes from 'lodash/includes';
import first from 'lodash/first'; import first from 'lodash/first';
import last from 'lodash/last'; import last from 'lodash/last';
import mergeWith from 'lodash/mergeWith';
import add from 'lodash/add';
import replace from 'lodash/replace';
import cloneDeep from 'lodash/cloneDeep';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
import has from 'lodash/has';
const DEFAULT_MARGIN: Margin = { top: 30, right: 20, bottom: 20, left: 30 };
const DEFAULT_TICK_COUNT = 4; const DEFAULT_TICK_COUNT = 4;
const DEFAULT_TICK_SIZE = 2; const DEFAULT_TICK_SIZE = 2;
const MILISECONDS_IN_MINUTE = 60 * 1000; const MILISECONDS_IN_MINUTE = 60 * 1000;
@ -173,6 +165,7 @@ abstract class ChartwerkPod<T extends CoreSerie, O extends Options> {
height: this.height, height: this.height,
width: this.width, width: this.width,
} }
// TODO: use instanses instead of oblects
this.state = new PodState(boxPararms, this.coreSeries.visibleSeries, this.coreOptions.allOptions); this.state = new PodState(boxPararms, this.coreSeries.visibleSeries, this.coreOptions.allOptions);
} }

3
src/models/options.ts

@ -51,6 +51,8 @@ const DEFAULT_CROSSHAIR_OPTIONS = {
color: 'gray', color: 'gray',
} }
const DEFAULT_MARGIN: Margin = { top: 30, right: 20, bottom: 20, left: 30 };
const DEFAULT_OPTIONS: Options = { const DEFAULT_OPTIONS: Options = {
zoomEvents: { zoomEvents: {
mouse: { mouse: {
@ -88,6 +90,7 @@ const DEFAULT_OPTIONS: Options = {
grid: DEFAULT_GRID_OPTIONS, grid: DEFAULT_GRID_OPTIONS,
crosshair: DEFAULT_CROSSHAIR_OPTIONS, crosshair: DEFAULT_CROSSHAIR_OPTIONS,
renderLegend: true, renderLegend: true,
margin: DEFAULT_MARGIN,
// remove options below // remove options below
renderTicksfromTimestamps: false, renderTicksfromTimestamps: false,
timeInterval: { timeInterval: {

Loading…
Cancel
Save