@carbon/charts 0.40.1 → 0.40.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/axis-chart.js +32 -5
- package/axis-chart.js.map +1 -1
- package/build/demo/data/toolbar.d.ts +12 -0
- package/build/src/components/axes/toolbar.d.ts +34 -0
- package/build/src/components/index.d.ts +1 -0
- package/build/src/configuration-non-customizable.d.ts +10 -0
- package/build/src/interfaces/a11y.d.ts +5 -1
- package/build/src/interfaces/components.d.ts +39 -1
- package/build/src/interfaces/enums.d.ts +8 -0
- package/build/src/interfaces/events.d.ts +7 -0
- package/build/src/services/zoom.d.ts +6 -0
- package/bundle.js +1 -1
- package/components/axes/toolbar.d.ts +34 -0
- package/components/axes/toolbar.js +388 -0
- package/components/axes/toolbar.js.map +1 -0
- package/components/axes/zoom-bar.js +5 -3
- package/components/axes/zoom-bar.js.map +1 -1
- package/components/essentials/title.js +3 -2
- package/components/essentials/title.js.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/configuration-non-customizable.d.ts +10 -0
- package/configuration-non-customizable.js +11 -1
- package/configuration-non-customizable.js.map +1 -1
- package/configuration.js +6 -0
- package/configuration.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/index.js +18 -0
- package/demo/data/index.js.map +1 -1
- package/demo/data/toolbar.d.ts +12 -0
- package/demo/data/toolbar.js +56 -0
- package/demo/data/toolbar.js.map +1 -0
- package/demo/styles.css +1958 -690
- package/demo/styles.css.map +1 -1
- package/demo/styles.min.css +1 -1
- package/demo/styles.min.css.map +1 -1
- package/demo/tsconfig.tsbuildinfo +24 -9
- package/interfaces/a11y.d.ts +5 -1
- package/interfaces/a11y.js +4 -0
- package/interfaces/a11y.js.map +1 -1
- package/interfaces/components.d.ts +39 -1
- package/interfaces/components.js.map +1 -1
- package/interfaces/enums.d.ts +8 -0
- package/interfaces/enums.js +9 -0
- package/interfaces/enums.js.map +1 -1
- package/interfaces/events.d.ts +7 -0
- package/interfaces/events.js +8 -0
- package/interfaces/events.js.map +1 -1
- package/package.json +1 -1
- package/services/zoom.d.ts +6 -0
- package/services/zoom.js +104 -0
- package/services/zoom.js.map +1 -1
- package/styles/components/_toolbar.scss +67 -0
- package/styles/components/index.scss +1 -0
- package/styles-g10.css +664 -0
- package/styles-g10.css.map +1 -1
- package/styles-g10.min.css +1 -1
- package/styles-g10.min.css.map +1 -1
- package/styles-g100.css +664 -0
- package/styles-g100.css.map +1 -1
- package/styles-g100.min.css +1 -1
- package/styles-g100.min.css.map +1 -1
- package/styles-g90.css +664 -0
- package/styles-g90.css.map +1 -1
- package/styles-g90.min.css +1 -1
- package/styles-g90.min.css.map +1 -1
- package/styles.css +664 -0
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/tsconfig.tsbuildinfo +43 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.40.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.40.1...v0.40.2) (2020-10-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @carbon/charts
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.40.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.40.0...v0.40.1) (2020-10-22)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @carbon/charts
|
package/axis-chart.js
CHANGED
|
@@ -20,7 +20,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
20
20
|
};
|
|
21
21
|
import { Chart } from "./chart";
|
|
22
22
|
import { LayoutDirection, LayoutGrowth, LegendOrientations, LegendPositions, AxisPositions, ScaleTypes } from "./interfaces";
|
|
23
|
-
import { ChartBrush, ChartClip, LayoutComponent, Legend, Title, AxisChartsTooltip, Spacer, ZoomBar } from "./components";
|
|
23
|
+
import { ChartBrush, ChartClip, LayoutComponent, Legend, Title, AxisChartsTooltip, Spacer, Toolbar, ZoomBar } from "./components";
|
|
24
24
|
import { Tools } from "./tools";
|
|
25
25
|
import { CartesianScales, Curves, Zoom } from "./services";
|
|
26
26
|
var AxisChart = /** @class */ (function (_super) {
|
|
@@ -36,6 +36,7 @@ var AxisChart = /** @class */ (function (_super) {
|
|
|
36
36
|
}
|
|
37
37
|
AxisChart.prototype.getAxisChartComponents = function (graphFrameComponents) {
|
|
38
38
|
var isZoomBarEnabled = Tools.getProperty(this.model.getOptions(), "zoomBar", "top", "enabled");
|
|
39
|
+
var toolbarEnabled = Tools.getProperty(this.model.getOptions(), "toolbar", "enabled");
|
|
39
40
|
this.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()
|
|
40
41
|
var mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();
|
|
41
42
|
var mainXScaleType = Tools.getProperty(this.model.getOptions(), "axes", mainXAxisPosition, "scaleType");
|
|
@@ -43,9 +44,33 @@ var AxisChart = /** @class */ (function (_super) {
|
|
|
43
44
|
var zoomBarEnabled = isZoomBarEnabled &&
|
|
44
45
|
mainXAxisPosition === AxisPositions.BOTTOM &&
|
|
45
46
|
mainXScaleType === ScaleTypes.TIME;
|
|
47
|
+
var titleAvailable = !!this.model.getOptions().title;
|
|
46
48
|
var titleComponent = {
|
|
47
49
|
id: "title",
|
|
48
50
|
components: [new Title(this.model, this.services)],
|
|
51
|
+
growth: {
|
|
52
|
+
x: LayoutGrowth.STRETCH,
|
|
53
|
+
y: LayoutGrowth.FIXED
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var toolbarComponent = {
|
|
57
|
+
id: "toolbar",
|
|
58
|
+
components: [new Toolbar(this.model, this.services)],
|
|
59
|
+
growth: {
|
|
60
|
+
x: LayoutGrowth.PREFERRED,
|
|
61
|
+
y: LayoutGrowth.FIXED
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var headerComponent = {
|
|
65
|
+
id: "header",
|
|
66
|
+
components: [
|
|
67
|
+
new LayoutComponent(this.model, this.services, __spreadArrays([
|
|
68
|
+
// always add title to keep layout correct
|
|
69
|
+
titleComponent
|
|
70
|
+
], (toolbarEnabled ? [toolbarComponent] : [])), {
|
|
71
|
+
direction: LayoutDirection.ROW
|
|
72
|
+
})
|
|
73
|
+
],
|
|
49
74
|
growth: {
|
|
50
75
|
x: LayoutGrowth.PREFERRED,
|
|
51
76
|
y: LayoutGrowth.FIXED
|
|
@@ -123,13 +148,15 @@ var AxisChart = /** @class */ (function (_super) {
|
|
|
123
148
|
y: LayoutGrowth.FIXED
|
|
124
149
|
}
|
|
125
150
|
};
|
|
126
|
-
// Add chart title if it exists
|
|
127
151
|
var topLevelLayoutComponents = [];
|
|
128
|
-
|
|
129
|
-
|
|
152
|
+
// header component is required for either title or toolbar
|
|
153
|
+
if (titleAvailable || toolbarEnabled) {
|
|
154
|
+
topLevelLayoutComponents.push(headerComponent);
|
|
130
155
|
var titleSpacerComponent = {
|
|
131
156
|
id: "spacer",
|
|
132
|
-
components: [
|
|
157
|
+
components: [
|
|
158
|
+
new Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined)
|
|
159
|
+
],
|
|
133
160
|
growth: {
|
|
134
161
|
x: LayoutGrowth.PREFERRED,
|
|
135
162
|
y: LayoutGrowth.FIXED
|
package/axis-chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis-chart.js","sourceRoot":"","sources":["axis-chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAGf,aAAa,EACb,UAAU,EACV,MA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AD,CAAC,AA1KD,CAA+B,KAAK,GA0KnC","sourcesContent":["import { Chart } from \"./chart\";\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions,\n\tAxisPositions,\n\tScaleTypes\n} from \"./interfaces\";\nimport {\n\tChartBrush,\n\tChartClip,\n\tLayoutComponent,\n\tLegend,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer,\n\tZoomBar\n} from \"./components\";\nimport { Tools } from \"./tools\";\n\nimport { CartesianScales, Curves, Zoom } from \"./services\";\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom\n\t});\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(graphFrameComponents: any[]) {\n\t\tconst isZoomBarEnabled = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"zoomBar\",\n\t\t\t\"top\",\n\t\t\t\"enabled\"\n\t\t);\n\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"axes\",\n\t\t\tmainXAxisPosition,\n\t\t\t\"scaleType\"\n\t\t);\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME;\n\n\t\tconst titleComponent = {\n\t\t\tid: \"title\",\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: \"legend\",\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tif (zoomBarEnabled) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: \"graph-frame\",\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t\"legend\",\n\t\t\t\t\"position\"\n\t\t\t);\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: \"spacer\",\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: \"full-frame\",\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: \"zoom-bar\",\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\t\tif (this.model.getOptions().title) {\n\t\t\ttopLevelLayoutComponents.push(titleComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: \"spacer\",\n\t\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\t\tgrowth: {\n\t\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t\t}\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t\t}\n\t\t\t)\n\t\t];\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"axis-chart.js","sourceRoot":"","sources":["axis-chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAGf,aAAa,EACb,UAAU,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,UAAU,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE3D;IAA+B,6BAAK;IAOnC,mBAAY,MAAe,EAAE,YAA2C;QAAxE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAC3B;QARD,cAAQ,GAAQ,MAAM,CAAC,MAAM,CAAC,KAAI,CAAC,QAAQ,EAAE;YAC5C,eAAe,EAAE,eAAe;YAChC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACV,CAAC,CAAC;;IAIH,CAAC;IAES,0CAAsB,GAAhC,UAAiC,oBAA2B;QAC3D,IAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CACzC,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D,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAElD,OAAO;YACN,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YAChD,IAAI,eAAe,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,gBAAC;AAAD,CAAC,AArND,CAA+B,KAAK,GAqNnC","sourcesContent":["import { Chart } from \"./chart\";\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions,\n\tAxisPositions,\n\tScaleTypes\n} from \"./interfaces\";\nimport {\n\tChartBrush,\n\tChartClip,\n\tLayoutComponent,\n\tLegend,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer,\n\tToolbar,\n\tZoomBar\n} from \"./components\";\nimport { Tools } from \"./tools\";\n\nimport { CartesianScales, Curves, Zoom } from \"./services\";\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom\n\t});\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(graphFrameComponents: any[]) {\n\t\tconst isZoomBarEnabled = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"zoomBar\",\n\t\t\t\"top\",\n\t\t\t\"enabled\"\n\t\t);\n\t\tconst toolbarEnabled = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"toolbar\",\n\t\t\t\"enabled\"\n\t\t);\n\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"axes\",\n\t\t\tmainXAxisPosition,\n\t\t\t\"scaleType\"\n\t\t);\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME;\n\n\t\tconst titleAvailable = !!this.model.getOptions().title;\n\t\tconst titleComponent = {\n\t\t\tid: \"title\",\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst toolbarComponent = {\n\t\t\tid: \"toolbar\",\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst headerComponent = {\n\t\t\tid: \"header\",\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : [])\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: \"legend\",\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tif (zoomBarEnabled) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: \"graph-frame\",\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t\"legend\",\n\t\t\t\t\"position\"\n\t\t\t);\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: \"spacer\",\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: \"full-frame\",\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: \"zoom-bar\",\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst topLevelLayoutComponents = [];\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: \"spacer\",\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(\n\t\t\t\t\t\tthis.model,\n\t\t\t\t\t\tthis.services,\n\t\t\t\t\t\ttoolbarEnabled ? { size: 15 } : undefined\n\t\t\t\t\t)\n\t\t\t\t],\n\t\t\t\tgrowth: {\n\t\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t\t}\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN\n\t\t\t\t}\n\t\t\t)\n\t\t];\n\t}\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const toolbarStackedBarTimeSeriesData: {
|
|
2
|
+
group: string;
|
|
3
|
+
date: Date;
|
|
4
|
+
value: number;
|
|
5
|
+
}[];
|
|
6
|
+
export declare const toolbarStackedBarTimeSeriesOptions: any;
|
|
7
|
+
export declare const toolbarLineTimeSeriesData: {
|
|
8
|
+
group: string;
|
|
9
|
+
date: Date;
|
|
10
|
+
value: number;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const toolbarLineTimeSeriesOptions: any;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Component } from "../component";
|
|
2
|
+
import { ToolbarControlTypes } from "../../interfaces";
|
|
3
|
+
export declare class Toolbar extends Component {
|
|
4
|
+
type: string;
|
|
5
|
+
overflowButton: any;
|
|
6
|
+
overflowMenu: any;
|
|
7
|
+
overflowMenuX: number;
|
|
8
|
+
overflowMenuY: number;
|
|
9
|
+
overflowMenuItemId: number;
|
|
10
|
+
init(): void;
|
|
11
|
+
render(animate?: boolean): void;
|
|
12
|
+
isOverflowMenuOpen(): boolean;
|
|
13
|
+
updateOverflowMenu(show: boolean): void;
|
|
14
|
+
focusOnPreviousEnabledMenuItem(currentItemIndex: any): void;
|
|
15
|
+
focusOnNextEnabledMenuItem(currentItemIndex: any): void;
|
|
16
|
+
toggleOverflowMenu(): void;
|
|
17
|
+
getOverflowMenuHTML(): any;
|
|
18
|
+
getControlConfigs(): {
|
|
19
|
+
buttonList: any[];
|
|
20
|
+
overflowMenuItemList?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
buttonList: any[];
|
|
23
|
+
overflowMenuItemList: any[];
|
|
24
|
+
};
|
|
25
|
+
getOverflowMenuItems(): any[];
|
|
26
|
+
getOverflowButtonConfig(): {
|
|
27
|
+
id: string;
|
|
28
|
+
shouldBeDisabled: () => boolean;
|
|
29
|
+
iconSVGContent: string;
|
|
30
|
+
clickFunction: () => void;
|
|
31
|
+
};
|
|
32
|
+
getControlConfigByType(controlType: ToolbarControlTypes): any;
|
|
33
|
+
getControlIconByType(controlType: ToolbarControlTypes): "<polygon points=\"19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13\"/>\n \t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>" | "<rect x=\"9\" y=\"13\" width=\"10\" height=\"2\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>" | "<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>";
|
|
34
|
+
}
|
|
@@ -102,10 +102,20 @@ export declare const transitions: {
|
|
|
102
102
|
duration: number;
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
|
+
export declare const toolbar: {
|
|
106
|
+
buttonSize: number;
|
|
107
|
+
iconSize: number;
|
|
108
|
+
height: number;
|
|
109
|
+
spacerHeight: number;
|
|
110
|
+
iconPadding: number;
|
|
111
|
+
};
|
|
105
112
|
export declare const zoomBar: {
|
|
106
113
|
height: {
|
|
107
114
|
[ZoomBarTypes.GRAPH_VIEW]: number;
|
|
108
115
|
[ZoomBarTypes.SLIDER_VIEW]: number;
|
|
109
116
|
};
|
|
110
117
|
spacerHeight: number;
|
|
118
|
+
handleWidth: number;
|
|
119
|
+
handleBarWidth: number;
|
|
120
|
+
handleBarHeight: number;
|
|
111
121
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LayoutGrowth, LegendPositions, Alignments, ZoomBarTypes } from "./enums";
|
|
1
|
+
import { LayoutGrowth, LegendPositions, Alignments, ToolbarControlTypes, ZoomBarTypes } from "./enums";
|
|
2
2
|
import { Component } from "../components/component";
|
|
3
3
|
import { TruncationOptions } from "./truncation";
|
|
4
4
|
/**
|
|
@@ -108,6 +108,39 @@ export interface BarOptions {
|
|
|
108
108
|
export interface StackedBarOptions extends BarOptions {
|
|
109
109
|
dividerSize?: number;
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* customize the Toolbar component
|
|
113
|
+
*/
|
|
114
|
+
export interface ToolbarOptions {
|
|
115
|
+
/**
|
|
116
|
+
* is the toolbar visible or not
|
|
117
|
+
*/
|
|
118
|
+
enabled?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* the maximum toolbar controls to be displayed as icons
|
|
121
|
+
* controls more than this number will appear in the overflow menu
|
|
122
|
+
* minimum is 1. (all toolbar controls are in overflow menu)
|
|
123
|
+
*/
|
|
124
|
+
numberOfIcons?: number;
|
|
125
|
+
/**
|
|
126
|
+
* toolbar controls which will be displayed following the array order
|
|
127
|
+
*/
|
|
128
|
+
controls?: ToolbarControl[];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* options for each toolbar control
|
|
132
|
+
*/
|
|
133
|
+
export interface ToolbarControl {
|
|
134
|
+
/**
|
|
135
|
+
* the toolbar control type
|
|
136
|
+
*/
|
|
137
|
+
type: ToolbarControlTypes;
|
|
138
|
+
/**
|
|
139
|
+
* the text to display (if this control is displayed in overflow menu)
|
|
140
|
+
* type value will be displayed if text is not available
|
|
141
|
+
*/
|
|
142
|
+
text?: string;
|
|
143
|
+
}
|
|
111
144
|
/**
|
|
112
145
|
* customize the ZoomBars in a chart
|
|
113
146
|
*/
|
|
@@ -117,6 +150,11 @@ export interface ZoomBarsOptions {
|
|
|
117
150
|
* ex: shift click zoom in ratio
|
|
118
151
|
*/
|
|
119
152
|
zoomRatio?: number;
|
|
153
|
+
/**
|
|
154
|
+
* a variable to define the minimum zoom ratio (0 ~ 1.0)
|
|
155
|
+
* If ( zoom domain / max domain ) < minZoomRatio, zoom-in functions will be disabled
|
|
156
|
+
*/
|
|
157
|
+
minZoomRatio?: number;
|
|
120
158
|
/**
|
|
121
159
|
* currently only the top position is supported
|
|
122
160
|
*/
|
|
@@ -153,3 +153,11 @@ export declare enum TickRotations {
|
|
|
153
153
|
AUTO = "auto",
|
|
154
154
|
NEVER = "never"
|
|
155
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* enum of supported toolbar control types
|
|
158
|
+
*/
|
|
159
|
+
export declare enum ToolbarControlTypes {
|
|
160
|
+
ZOOM_IN = "Zoom in",
|
|
161
|
+
ZOOM_OUT = "Zoom out",
|
|
162
|
+
RESET_ZOOM = "Reset zoom"
|
|
163
|
+
}
|
|
@@ -13,6 +13,13 @@ export declare enum Chart {
|
|
|
13
13
|
export declare enum Model {
|
|
14
14
|
UPDATE = "model-update"
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* enum of all toolbar events
|
|
18
|
+
*/
|
|
19
|
+
export declare enum Toolbar {
|
|
20
|
+
SHOW_OVERFLOW_MENU = "show-toolbar-overflow-menu",
|
|
21
|
+
HIDE_OVERFLOW_MENU = "hide-toolbar-overflow-menu"
|
|
22
|
+
}
|
|
16
23
|
/**
|
|
17
24
|
* enum of all events related to the zoom-bar
|
|
18
25
|
*/
|
|
@@ -8,4 +8,10 @@ export declare class Zoom extends Service {
|
|
|
8
8
|
}): void;
|
|
9
9
|
getZoomRatio(): any;
|
|
10
10
|
filterDataForRangeAxis(displayData: object[], configs?: any): object[];
|
|
11
|
+
zoomIn(zoomRatio?: any): void;
|
|
12
|
+
zoomOut(zoomRatio?: any): void;
|
|
13
|
+
resetZoomDomain(): void;
|
|
14
|
+
isMinZoomDomain(): boolean;
|
|
15
|
+
isMaxZoomDomain(): boolean;
|
|
16
|
+
isEmptyState(): boolean;
|
|
11
17
|
}
|