@carbon/charts 0.50.9 → 0.51.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 +44 -0
- package/build/demo/data/circle-pack.d.ts +0 -6
- package/build/src/charts/alluvial.d.ts +2 -0
- package/build/src/charts/bullet.d.ts +2 -0
- package/build/src/charts/radar.d.ts +3 -1
- package/build/src/charts/tree.d.ts +2 -0
- package/build/src/charts/treemap.d.ts +2 -0
- package/build/src/charts/wordcloud.d.ts +2 -0
- package/build/src/components/axes/toolbar.d.ts +4 -0
- package/build/src/components/essentials/legend.d.ts +1 -1
- package/build/src/components/graphs/bullet.d.ts +0 -1
- package/build/src/model/alluvial.d.ts +8 -0
- package/build/src/model/boxplot.d.ts +1 -0
- package/build/src/model/bullet.d.ts +14 -0
- package/build/src/model/cartesian-charts.d.ts +0 -1
- package/build/src/model/circle-pack.d.ts +10 -0
- package/build/src/model/gauge.d.ts +4 -1
- package/build/src/model/meter.d.ts +1 -0
- package/build/src/model/model.d.ts +2 -0
- package/build/src/model/pie.d.ts +1 -0
- package/build/src/model/radar.d.ts +7 -0
- package/build/src/model/tree.d.ts +14 -0
- package/build/src/model/treemap.d.ts +8 -0
- package/build/src/model/wordcloud.d.ts +7 -0
- package/build/src/services/essentials/dom-utils.d.ts +3 -0
- package/bundle.js +1 -1
- package/chart.js +42 -20
- package/chart.js.map +1 -1
- package/charts/alluvial.d.ts +2 -0
- package/charts/alluvial.js +2 -0
- package/charts/alluvial.js.map +1 -1
- package/charts/bullet.d.ts +2 -0
- package/charts/bullet.js +2 -0
- package/charts/bullet.js.map +1 -1
- package/charts/radar.d.ts +3 -1
- package/charts/radar.js +3 -7
- package/charts/radar.js.map +1 -1
- package/charts/tree.d.ts +2 -0
- package/charts/tree.js +2 -0
- package/charts/tree.js.map +1 -1
- package/charts/treemap.d.ts +2 -0
- package/charts/treemap.js +2 -0
- package/charts/treemap.js.map +1 -1
- package/charts/wordcloud.d.ts +2 -0
- package/charts/wordcloud.js +3 -0
- package/charts/wordcloud.js.map +1 -1
- package/components/axes/toolbar.d.ts +4 -0
- package/components/axes/toolbar.js +147 -58
- package/components/axes/toolbar.js.map +1 -1
- package/components/axes/zoom-bar.js +12 -3
- package/components/axes/zoom-bar.js.map +1 -1
- package/components/component.js +2 -6
- package/components/component.js.map +1 -1
- package/components/essentials/legend.d.ts +1 -1
- package/components/essentials/legend.js +36 -10
- package/components/essentials/legend.js.map +1 -1
- package/components/essentials/modal.js +3 -3
- package/components/essentials/modal.js.map +1 -1
- package/components/essentials/title.js +2 -2
- package/components/essentials/title.js.map +1 -1
- package/components/essentials/tooltip.js +2 -2
- package/components/essentials/tooltip.js.map +1 -1
- package/components/graphs/alluvial.js +29 -12
- package/components/graphs/alluvial.js.map +1 -1
- package/components/graphs/area-stacked.js +1 -0
- package/components/graphs/area-stacked.js.map +1 -1
- package/components/graphs/area.js +2 -4
- package/components/graphs/area.js.map +1 -1
- package/components/graphs/boxplot.js +1 -0
- package/components/graphs/boxplot.js.map +1 -1
- package/components/graphs/bubble.js +4 -0
- package/components/graphs/bubble.js.map +1 -1
- package/components/graphs/bullet.d.ts +0 -1
- package/components/graphs/bullet.js +1 -12
- package/components/graphs/bullet.js.map +1 -1
- package/components/graphs/gauge.js +2 -4
- package/components/graphs/gauge.js.map +1 -1
- package/components/graphs/histogram.js +3 -1
- package/components/graphs/histogram.js.map +1 -1
- package/components/graphs/pie.js +1 -1
- package/components/graphs/pie.js.map +1 -1
- package/components/graphs/radar.js +8 -7
- package/components/graphs/radar.js.map +1 -1
- package/components/graphs/skeleton-lines.js +8 -3
- package/components/graphs/skeleton-lines.js.map +1 -1
- package/components/graphs/skeleton.js +18 -5
- package/components/graphs/skeleton.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/circle-pack.d.ts +0 -6
- package/demo/data/circle-pack.js +0 -6
- package/demo/data/circle-pack.js.map +1 -1
- package/demo/styles.css +45 -93
- 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 +3 -3
- package/demo/utils.js +2 -2
- package/demo/utils.js.map +1 -1
- package/model/alluvial.d.ts +8 -0
- package/model/alluvial.js +47 -0
- package/model/alluvial.js.map +1 -0
- package/model/boxplot.d.ts +1 -0
- package/model/boxplot.js +54 -0
- package/model/boxplot.js.map +1 -1
- package/model/bullet.d.ts +14 -0
- package/model/bullet.js +74 -0
- package/model/bullet.js.map +1 -0
- package/model/cartesian-charts.d.ts +0 -1
- package/model/cartesian-charts.js +0 -11
- package/model/cartesian-charts.js.map +1 -1
- package/model/circle-pack.d.ts +10 -0
- package/model/circle-pack.js +51 -0
- package/model/circle-pack.js.map +1 -1
- package/model/gauge.d.ts +4 -1
- package/model/gauge.js +24 -1
- package/model/gauge.js.map +1 -1
- package/model/meter.d.ts +1 -0
- package/model/meter.js +40 -0
- package/model/meter.js.map +1 -1
- package/model/model.d.ts +2 -0
- package/model/model.js +14 -0
- package/model/model.js.map +1 -1
- package/model/pie.d.ts +1 -0
- package/model/pie.js +21 -0
- package/model/pie.js.map +1 -1
- package/model/radar.d.ts +7 -0
- package/model/radar.js +52 -0
- package/model/radar.js.map +1 -0
- package/model/tree.d.ts +14 -0
- package/model/tree.js +56 -0
- package/model/tree.js.map +1 -0
- package/model/treemap.d.ts +8 -0
- package/model/treemap.js +37 -0
- package/model/treemap.js.map +1 -0
- package/model/wordcloud.d.ts +7 -0
- package/model/wordcloud.js +47 -0
- package/model/wordcloud.js.map +1 -0
- package/package.json +1 -1
- package/services/angle-utils.js +3 -1
- package/services/angle-utils.js.map +1 -1
- package/services/essentials/dom-utils.d.ts +3 -0
- package/services/essentials/dom-utils.js +9 -1
- package/services/essentials/dom-utils.js.map +1 -1
- package/styles/components/_skeleton-lines.scss +1 -2
- package/styles/components/_skeleton.scss +2 -7
- package/styles/components/_toolbar.scss +1 -1
- package/styles/components/_tooltip.scss +4 -2
- package/styles/components/_zoom-bar.scss +0 -12
- package/styles-g10.css +11 -23
- 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 +11 -23
- 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 +11 -23
- 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 +11 -23
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/tsconfig.tsbuildinfo +162 -53
package/chart.js
CHANGED
|
@@ -6,10 +6,10 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
6
6
|
return r;
|
|
7
7
|
};
|
|
8
8
|
// Internal Imports
|
|
9
|
-
import { LayoutGrowth, LayoutDirection, LegendOrientations, Events as ChartEvents, RenderTypes, } from './interfaces';
|
|
9
|
+
import { LayoutGrowth, LayoutAlignItems, LayoutDirection, LegendOrientations, Events as ChartEvents, RenderTypes, } from './interfaces';
|
|
10
10
|
// Misc
|
|
11
11
|
import { ChartModel } from './model/model';
|
|
12
|
-
import { Modal, Title, Legend, LayoutComponent, Tooltip, Spacer, CanvasChartClip, } from './components';
|
|
12
|
+
import { Modal, Title, Legend, LayoutComponent, Toolbar, Tooltip, Spacer, CanvasChartClip, } from './components';
|
|
13
13
|
import { Tools } from './tools';
|
|
14
14
|
// Services
|
|
15
15
|
import { CanvasZoom, DOMUtils, Events, Files, GradientUtils, Transitions, } from './services/index';
|
|
@@ -87,46 +87,66 @@ var Chart = /** @class */ (function () {
|
|
|
87
87
|
this.model.set({ destroyed: true }, { skipUpdate: true });
|
|
88
88
|
};
|
|
89
89
|
Chart.prototype.getChartComponents = function (graphFrameComponents, configs) {
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
components: [new Title(this.model, this.services)],
|
|
93
|
-
growth: LayoutGrowth.PREFERRED,
|
|
94
|
-
};
|
|
90
|
+
var options = this.model.getOptions();
|
|
91
|
+
var toolbarEnabled = Tools.getProperty(options, 'toolbar', 'enabled');
|
|
95
92
|
var legendComponent = {
|
|
96
93
|
id: 'legend',
|
|
97
94
|
components: [new Legend(this.model, this.services)],
|
|
98
95
|
growth: LayoutGrowth.PREFERRED,
|
|
99
96
|
};
|
|
100
97
|
// if canvas zoom is enabled
|
|
101
|
-
var isZoomEnabled = Tools.getProperty(
|
|
98
|
+
var isZoomEnabled = Tools.getProperty(options, 'canvasZoom', 'enabled');
|
|
102
99
|
if (isZoomEnabled && isZoomEnabled === true) {
|
|
103
100
|
graphFrameComponents.push(new CanvasChartClip(this.model, this.services));
|
|
104
101
|
}
|
|
102
|
+
var titleAvailable = !!this.model.getOptions().title;
|
|
103
|
+
var titleComponent = {
|
|
104
|
+
id: 'title',
|
|
105
|
+
components: [new Title(this.model, this.services)],
|
|
106
|
+
growth: LayoutGrowth.STRETCH,
|
|
107
|
+
};
|
|
108
|
+
var toolbarComponent = {
|
|
109
|
+
id: 'toolbar',
|
|
110
|
+
components: [new Toolbar(this.model, this.services)],
|
|
111
|
+
growth: LayoutGrowth.PREFERRED,
|
|
112
|
+
};
|
|
113
|
+
var headerComponent = {
|
|
114
|
+
id: 'header',
|
|
115
|
+
components: [
|
|
116
|
+
new LayoutComponent(this.model, this.services, __spreadArrays([
|
|
117
|
+
// always add title to keep layout correct
|
|
118
|
+
titleComponent
|
|
119
|
+
], (toolbarEnabled ? [toolbarComponent] : [])), {
|
|
120
|
+
direction: LayoutDirection.ROW,
|
|
121
|
+
alignItems: LayoutAlignItems.CENTER,
|
|
122
|
+
}),
|
|
123
|
+
],
|
|
124
|
+
growth: LayoutGrowth.PREFERRED,
|
|
125
|
+
};
|
|
105
126
|
var graphFrameComponent = {
|
|
106
127
|
id: 'graph-frame',
|
|
107
128
|
components: graphFrameComponents,
|
|
108
129
|
growth: LayoutGrowth.STRETCH,
|
|
109
|
-
renderType: Tools.getProperty(configs, 'graphFrameRenderType') ||
|
|
130
|
+
renderType: Tools.getProperty(configs, 'graphFrameRenderType') ||
|
|
131
|
+
RenderTypes.SVG,
|
|
110
132
|
};
|
|
111
133
|
var isLegendEnabled = Tools.getProperty(configs, 'excludeLegend') !== true &&
|
|
112
|
-
|
|
134
|
+
options.legend.enabled !== false;
|
|
113
135
|
// TODORF - REUSE BETWEEN AXISCHART & CHART
|
|
114
136
|
// Decide the position of the legend in reference to the chart
|
|
115
137
|
var fullFrameComponentDirection = LayoutDirection.COLUMN;
|
|
116
138
|
if (isLegendEnabled) {
|
|
117
|
-
var legendPosition = Tools.getProperty(
|
|
139
|
+
var legendPosition = Tools.getProperty(options, 'legend', 'position');
|
|
118
140
|
if (legendPosition === 'left') {
|
|
119
141
|
fullFrameComponentDirection = LayoutDirection.ROW;
|
|
120
|
-
if (!
|
|
121
|
-
|
|
122
|
-
LegendOrientations.VERTICAL;
|
|
142
|
+
if (!options.legend.orientation) {
|
|
143
|
+
options.legend.orientation = LegendOrientations.VERTICAL;
|
|
123
144
|
}
|
|
124
145
|
}
|
|
125
146
|
else if (legendPosition === 'right') {
|
|
126
147
|
fullFrameComponentDirection = LayoutDirection.ROW_REVERSE;
|
|
127
|
-
if (!
|
|
128
|
-
|
|
129
|
-
LegendOrientations.VERTICAL;
|
|
148
|
+
if (!options.legend.orientation) {
|
|
149
|
+
options.legend.orientation = LegendOrientations.VERTICAL;
|
|
130
150
|
}
|
|
131
151
|
}
|
|
132
152
|
else if (legendPosition === 'bottom') {
|
|
@@ -151,11 +171,13 @@ var Chart = /** @class */ (function () {
|
|
|
151
171
|
};
|
|
152
172
|
// Add chart title if it exists
|
|
153
173
|
var topLevelLayoutComponents = [];
|
|
154
|
-
if (
|
|
155
|
-
topLevelLayoutComponents.push(
|
|
174
|
+
if (titleAvailable || toolbarEnabled) {
|
|
175
|
+
topLevelLayoutComponents.push(headerComponent);
|
|
156
176
|
var titleSpacerComponent = {
|
|
157
177
|
id: 'spacer',
|
|
158
|
-
components: [
|
|
178
|
+
components: [
|
|
179
|
+
new Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined),
|
|
180
|
+
],
|
|
159
181
|
growth: LayoutGrowth.PREFERRED,
|
|
160
182
|
};
|
|
161
183
|
topLevelLayoutComponents.push(titleSpacerComponent);
|
package/chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","sourceRoot":"","sources":["chart.ts"],"names":[],"mappings":";;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAGN,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,MAAM,IAAI,WAAW,EACrB,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEN,KAAK,EACL,KAAK,EACL,MAAM,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,WAAW;AACX,OAAO,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,aAAa,EACb,WAAW,GACX,MAAM,kBAAkB,CAAC;AAE1B;IAYC,eAAY,MAAe,EAAE,YAA2C;QAVxE,aAAQ,GAAQ;YACf,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,aAAa;YAC5B,WAAW,EAAE,WAAW;YACxB,UAAU,EAAE,UAAU;SACtB,CAAC;QACF,UAAK,GAAe,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEyB,CAAC;IAE5E,iFAAiF;IACjF,oBAAI,GAAJ,UAAK,MAAe,EAAE,YAA2C;QAAjE,iBA8BC;QA7BA,gCAAgC;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,QAAA,EAAE,EAAE,EAAE,UAAU,EAAE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ChartOptions,\n\tLayoutGrowth,\n\tLayoutDirection,\n\tLegendOrientations,\n\tEvents as ChartEvents,\n\tRenderTypes,\n} from './interfaces';\n\n// Misc\nimport { ChartModel } from './model/model';\nimport {\n\tComponent,\n\tModal,\n\tTitle,\n\tLegend,\n\tLayoutComponent,\n\tTooltip,\n\tSpacer,\n\tCanvasChartClip,\n} from './components';\nimport { Tools } from './tools';\n\n// Services\nimport {\n\tCanvasZoom,\n\tDOMUtils,\n\tEvents,\n\tFiles,\n\tGradientUtils,\n\tTransitions,\n} from './services/index';\n\nexport class Chart {\n\tcomponents: Component[];\n\tservices: any = {\n\t\tdomUtils: DOMUtils,\n\t\tfiles: Files,\n\t\tevents: Events,\n\t\tgradientUtils: GradientUtils,\n\t\ttransitions: Transitions,\n\t\tcanvasZoom: CanvasZoom,\n\t};\n\tmodel: ChartModel = new ChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {}\n\n\t// Contains the code that uses properties that are overridable by the super-class\n\tinit(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {\n\t\t// Store the holder in the model\n\t\tthis.model.set({ holder }, { skipUpdate: true });\n\n\t\t// Initialize all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tthis.services[serviceName] = new serviceObj(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services\n\t\t\t);\n\t\t});\n\n\t\t// Call update() when model has been updated\n\t\tthis.services.events.addEventListener(ChartEvents.Model.UPDATE, (e) => {\n\t\t\tconst animate = !!Tools.getProperty(e, 'detail', 'animate');\n\t\t\tthis.update(animate);\n\t\t});\n\n\t\t// Set model data & options\n\t\tthis.model.setData(chartConfigs.data);\n\n\t\t// Set chart resize event listener\n\t\tthis.services.events.addEventListener(ChartEvents.Chart.RESIZE, () => {\n\t\t\tthis.update(false);\n\t\t});\n\n\t\tthis.components = this.getComponents();\n\n\t\tthis.update();\n\t}\n\n\tgetComponents(): any[] {\n\t\tconsole.error('getComponents() method is not implemented');\n\n\t\treturn null;\n\t}\n\n\tupdate(animate = true) {\n\t\tif (!this.components) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tserviceObj.update();\n\t\t});\n\n\t\t// Render all components\n\t\tthis.components.forEach((component) => component.render(animate));\n\n\t\t// Asynchronously dispatch a \"render-finished\" event\n\t\t// This is needed because of d3-transitions\n\t\t// Since at the start of the transition\n\t\t// Elements do not hold their final size or position\n\t\tconst pendingTransitions = this.services.transitions.getPendingTransitions();\n\t\tconst promises = Object.keys(pendingTransitions).map((transitionID) => {\n\t\t\tconst transition = pendingTransitions[transitionID];\n\t\t\treturn transition.end().catch((e) => e); // Skip rejects since we don't care about those;\n\t\t});\n\n\t\tPromise.all(promises).then(() =>\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tChartEvents.Chart.RENDER_FINISHED\n\t\t\t)\n\t\t);\n\t}\n\n\tdestroy() {\n\t\t// Call the destroy() method on all components\n\t\tthis.components.forEach((component) => component.destroy());\n\n\t\t// Remove the chart holder\n\t\tthis.services.domUtils.getHolder().remove();\n\n\t\tthis.model.set({ destroyed: true }, { skipUpdate: true });\n\t}\n\n\tprotected getChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tconfigs?: object\n\t) {\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\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: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\t// if canvas zoom is enabled\n\t\tconst isZoomEnabled = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'canvasZoom',\n\t\t\t'enabled'\n\t\t);\n\n\t\tif (isZoomEnabled && isZoomEnabled === true) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew CanvasChartClip(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: LayoutGrowth.STRETCH,\n\t\t\trenderType: Tools.getProperty(configs, 'graphFrameRenderType') || RenderTypes.SVG,\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tTools.getProperty(configs, 'excludeLegend') !== true &&\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\t\t// TODORF - REUSE BETWEEN AXISCHART & CHART\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 === '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 === '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 === '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: LayoutGrowth.PREFERRED,\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: LayoutGrowth.STRETCH,\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: LayoutGrowth.PREFERRED,\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(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":"chart.js","sourceRoot":"","sources":["chart.ts"],"names":[],"mappings":";;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAGN,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,MAAM,IAAI,WAAW,EACrB,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe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,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,YAAC;AAAD,CAAC,AA5PD,IA4PC","sourcesContent":["// Internal Imports\nimport {\n\tChartConfig,\n\tBaseChartOptions,\n\tLayoutGrowth,\n\tLayoutAlignItems,\n\tLayoutDirection,\n\tLegendOrientations,\n\tEvents as ChartEvents,\n\tRenderTypes,\n} from './interfaces';\n\n// Misc\nimport { ChartModel } from './model/model';\nimport {\n\tComponent,\n\tModal,\n\tTitle,\n\tLegend,\n\tLayoutComponent,\n\tToolbar,\n\tTooltip,\n\tSpacer,\n\tCanvasChartClip,\n} from './components';\nimport { Tools } from './tools';\n\n// Services\nimport {\n\tCanvasZoom,\n\tDOMUtils,\n\tEvents,\n\tFiles,\n\tGradientUtils,\n\tTransitions,\n} from './services/index';\n\nexport class Chart {\n\tcomponents: Component[];\n\tservices: any = {\n\t\tdomUtils: DOMUtils,\n\t\tfiles: Files,\n\t\tevents: Events,\n\t\tgradientUtils: GradientUtils,\n\t\ttransitions: Transitions,\n\t\tcanvasZoom: CanvasZoom,\n\t};\n\tmodel: ChartModel = new ChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {}\n\n\t// Contains the code that uses properties that are overridable by the super-class\n\tinit(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {\n\t\t// Store the holder in the model\n\t\tthis.model.set({ holder }, { skipUpdate: true });\n\n\t\t// Initialize all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tthis.services[serviceName] = new serviceObj(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services\n\t\t\t);\n\t\t});\n\n\t\t// Call update() when model has been updated\n\t\tthis.services.events.addEventListener(ChartEvents.Model.UPDATE, (e) => {\n\t\t\tconst animate = !!Tools.getProperty(e, 'detail', 'animate');\n\t\t\tthis.update(animate);\n\t\t});\n\n\t\t// Set model data & options\n\t\tthis.model.setData(chartConfigs.data);\n\n\t\t// Set chart resize event listener\n\t\tthis.services.events.addEventListener(ChartEvents.Chart.RESIZE, () => {\n\t\t\tthis.update(false);\n\t\t});\n\n\t\tthis.components = this.getComponents();\n\n\t\tthis.update();\n\t}\n\n\tgetComponents(): any[] {\n\t\tconsole.error('getComponents() method is not implemented');\n\n\t\treturn null;\n\t}\n\n\tupdate(animate = true) {\n\t\tif (!this.components) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tserviceObj.update();\n\t\t});\n\n\t\t// Render all components\n\t\tthis.components.forEach((component) => component.render(animate));\n\n\t\t// Asynchronously dispatch a \"render-finished\" event\n\t\t// This is needed because of d3-transitions\n\t\t// Since at the start of the transition\n\t\t// Elements do not hold their final size or position\n\t\tconst pendingTransitions = this.services.transitions.getPendingTransitions();\n\t\tconst promises = Object.keys(pendingTransitions).map((transitionID) => {\n\t\t\tconst transition = pendingTransitions[transitionID];\n\t\t\treturn transition.end().catch((e) => e); // Skip rejects since we don't care about those;\n\t\t});\n\n\t\tPromise.all(promises).then(() =>\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tChartEvents.Chart.RENDER_FINISHED\n\t\t\t)\n\t\t);\n\t}\n\n\tdestroy() {\n\t\t// Call the destroy() method on all components\n\t\tthis.components.forEach((component) => component.destroy());\n\n\t\t// Remove the chart holder\n\t\tthis.services.domUtils.getHolder().remove();\n\n\t\tthis.model.set({ destroyed: true }, { skipUpdate: true });\n\t}\n\n\tprotected getChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tconfigs?: object\n\t) {\n\t\tconst options = this.model.getOptions();\n\n\t\tconst toolbarEnabled = Tools.getProperty(options, 'toolbar', 'enabled');\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\t// if canvas zoom is enabled\n\t\tconst isZoomEnabled = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'canvasZoom',\n\t\t\t'enabled'\n\t\t);\n\n\t\tif (isZoomEnabled && isZoomEnabled === true) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew CanvasChartClip(this.model, this.services)\n\t\t\t);\n\t\t}\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: LayoutGrowth.STRETCH,\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: LayoutGrowth.PREFERRED,\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\talignItems: LayoutAlignItems.CENTER,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType:\n\t\t\t\tTools.getProperty(configs, 'graphFrameRenderType') ||\n\t\t\t\tRenderTypes.SVG,\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tTools.getProperty(configs, 'excludeLegend') !== true &&\n\t\t\toptions.legend.enabled !== false;\n\t\t// TODORF - REUSE BETWEEN AXISCHART & CHART\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\toptions,\n\t\t\t\t'legend',\n\t\t\t\t'position'\n\t\t\t);\n\t\t\tif (legendPosition === 'left') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!options.legend.orientation) {\n\t\t\t\t\toptions.legend.orientation = LegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'right') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!options.legend.orientation) {\n\t\t\t\t\toptions.legend.orientation = LegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === '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: LayoutGrowth.PREFERRED,\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: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\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: LayoutGrowth.PREFERRED,\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(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"]}
|
package/charts/alluvial.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Chart } from '../chart';
|
|
2
|
+
import { AlluvialChartModel } from '../model/alluvial';
|
|
2
3
|
import { ChartConfig, AlluvialChartOptions } from '../interfaces/index';
|
|
3
4
|
export declare class AlluvialChart extends Chart {
|
|
5
|
+
model: AlluvialChartModel;
|
|
4
6
|
constructor(holder: Element, chartConfigs: ChartConfig<AlluvialChartOptions>);
|
|
5
7
|
getComponents(): any[];
|
|
6
8
|
}
|
package/charts/alluvial.js
CHANGED
|
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
})();
|
|
14
14
|
// Internal Imports
|
|
15
15
|
import { Chart } from '../chart';
|
|
16
|
+
import { AlluvialChartModel } from '../model/alluvial';
|
|
16
17
|
import * as Configuration from '../configuration';
|
|
17
18
|
import { Tools } from '../tools';
|
|
18
19
|
// Components
|
|
@@ -21,6 +22,7 @@ var AlluvialChart = /** @class */ (function (_super) {
|
|
|
21
22
|
__extends(AlluvialChart, _super);
|
|
22
23
|
function AlluvialChart(holder, chartConfigs) {
|
|
23
24
|
var _this = _super.call(this, holder, chartConfigs) || this;
|
|
25
|
+
_this.model = new AlluvialChartModel(_this.services);
|
|
24
26
|
// Merge the default options for this chart
|
|
25
27
|
// With the user provided options
|
|
26
28
|
_this.model.setOptions(Tools.mergeDefaultChartOptions(Configuration.options.alluvialChart, chartConfigs.options));
|
package/charts/alluvial.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alluvial.js","sourceRoot":"","sources":["alluvial.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EACN,QAAQ,GAKR,MAAM,qBAAqB,CAAC;AAE7B;IAAmC,iCAAK;
|
|
1
|
+
{"version":3,"file":"alluvial.js","sourceRoot":"","sources":["alluvial.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EACN,QAAQ,GAKR,MAAM,qBAAqB,CAAC;AAE7B;IAAmC,iCAAK;IAGvC,uBACC,MAAe,EACf,YAA+C;QAFhD,YAIC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAa3B;QAnBD,WAAK,GAAG,IAAI,kBAAkB,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAQ7C,2CAA2C;QAC3C,iCAAiC;QACjC,KAAI,CAAC,KAAK,CAAC,UAAU,CACpB,KAAK,CAAC,wBAAwB,CAC7B,aAAa,CAAC,OAAO,CAAC,aAAa,EACnC,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QAEF,6CAA6C;QAC7C,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;IACjC,CAAC;IAED,qCAAa,GAAb;QACC,gDAAgD;QAChD,IAAM,oBAAoB,GAAQ;YACjC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;SACvC,CAAC;QAEF,IAAM,UAAU,GAAU,IAAI,CAAC,kBAAkB,CAChD,oBAAoB,EACpB;YACC,aAAa,EAAE,IAAI;SACnB,CACD,CAAC;QACF,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,oBAAC;AAAD,CAAC,AApCD,CAAmC,KAAK,GAoCvC","sourcesContent":["// Internal Imports\nimport { Chart } from '../chart';\nimport { AlluvialChartModel } from '../model/alluvial';\nimport * as Configuration from '../configuration';\nimport { ChartConfig, AlluvialChartOptions } from '../interfaces/index';\nimport { Tools } from '../tools';\n\n// Components\nimport {\n\tAlluvial,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tTooltip,\n\tLegend,\n\tLayoutComponent,\n} from '../components/index';\n\nexport class AlluvialChart extends Chart {\n\tmodel = new AlluvialChartModel(this.services);\n\n\tconstructor(\n\t\tholder: Element,\n\t\tchartConfigs: ChartConfig<AlluvialChartOptions>\n\t) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tTools.mergeDefaultChartOptions(\n\t\t\t\tConfiguration.options.alluvialChart,\n\t\t\t\tchartConfigs.options\n\t\t\t)\n\t\t);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: any = [\n\t\t\tnew Alluvial(this.model, this.services),\n\t\t];\n\n\t\tconst components: any[] = this.getChartComponents(\n\t\t\tgraphFrameComponents,\n\t\t\t{\n\t\t\t\texcludeLegend: true,\n\t\t\t}\n\t\t);\n\t\treturn components;\n\t}\n}\n"]}
|
package/charts/bullet.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AxisChart } from '../axis-chart';
|
|
2
|
+
import { BulletChartModel } from '../model/bullet';
|
|
2
3
|
import { ChartConfig, BulletChartOptions } from '../interfaces/index';
|
|
3
4
|
export declare class BulletChart extends AxisChart {
|
|
5
|
+
model: BulletChartModel;
|
|
4
6
|
constructor(holder: Element, chartConfigs: ChartConfig<BulletChartOptions>);
|
|
5
7
|
getComponents(): any[];
|
|
6
8
|
}
|
package/charts/bullet.js
CHANGED
|
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
})();
|
|
14
14
|
// Internal Imports
|
|
15
15
|
import { AxisChart } from '../axis-chart';
|
|
16
|
+
import { BulletChartModel } from '../model/bullet';
|
|
16
17
|
import * as Configuration from '../configuration';
|
|
17
18
|
import { Tools } from '../tools';
|
|
18
19
|
import { Skeletons } from '../interfaces/enums';
|
|
@@ -22,6 +23,7 @@ var BulletChart = /** @class */ (function (_super) {
|
|
|
22
23
|
__extends(BulletChart, _super);
|
|
23
24
|
function BulletChart(holder, chartConfigs) {
|
|
24
25
|
var _this = _super.call(this, holder, chartConfigs) || this;
|
|
26
|
+
_this.model = new BulletChartModel(_this.services);
|
|
25
27
|
// Merge the default options for this chart
|
|
26
28
|
// With the user provided options
|
|
27
29
|
_this.model.setOptions(Tools.mergeDefaultChartOptions(Configuration.options.bulletChart, chartConfigs.options));
|
package/charts/bullet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullet.js","sourceRoot":"","sources":["bullet.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,aAAa;AACb,OAAO,EACN,MAAM,EACN,IAAI,EACJ,kBAAkB,EAIlB,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAE7B;IAAiC,+BAAS;
|
|
1
|
+
{"version":3,"file":"bullet.js","sourceRoot":"","sources":["bullet.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,aAAa;AACb,OAAO,EACN,MAAM,EACN,IAAI,EACJ,kBAAkB,EAIlB,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAE7B;IAAiC,+BAAS;IAGzC,qBACC,MAAe,EACf,YAA6C;QAF9C,YAIC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAa3B;QAnBD,WAAK,GAAG,IAAI,gBAAgB,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAQ3C,2CAA2C;QAC3C,iCAAiC;QACjC,KAAI,CAAC,KAAK,CAAC,UAAU,CACpB,KAAK,CAAC,wBAAwB,CAC7B,aAAa,CAAC,OAAO,CAAC,WAAW,EACjC,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QAEF,6CAA6C;QAC7C,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;IACjC,CAAC;IAED,mCAAa,GAAb;QACC,gDAAgD;QAChD,IAAM,oBAAoB,GAAU;YACnC,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACjD,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACnC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACrC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE;gBACvC,QAAQ,EAAE,SAAS,CAAC,IAAI;aACxB,CAAC;SACF,CAAC;QAEF,IAAM,UAAU,GAAU,IAAI,CAAC,sBAAsB,CACpD,oBAAoB,CACpB,CAAC;QACF,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,kBAAC;AAAD,CAAC,AAtCD,CAAiC,SAAS,GAsCzC","sourcesContent":["// Internal Imports\nimport { AxisChart } from '../axis-chart';\nimport { BulletChartModel } from '../model/bullet';\nimport * as Configuration from '../configuration';\nimport { ChartConfig, BulletChartOptions } from '../interfaces/index';\nimport { Tools } from '../tools';\nimport { Skeletons } from '../interfaces/enums';\n\n// Components\nimport {\n\tBullet,\n\tGrid,\n\tTwoDimensionalAxes,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tTooltip,\n\tLayoutComponent,\n\tSkeleton,\n} from '../components/index';\n\nexport class BulletChart extends AxisChart {\n\tmodel = new BulletChartModel(this.services);\n\n\tconstructor(\n\t\tholder: Element,\n\t\tchartConfigs: ChartConfig<BulletChartOptions>\n\t) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tTools.mergeDefaultChartOptions(\n\t\t\t\tConfiguration.options.bulletChart,\n\t\t\t\tchartConfigs.options\n\t\t\t)\n\t\t);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: any[] = [\n\t\t\tnew TwoDimensionalAxes(this.model, this.services),\n\t\t\tnew Grid(this.model, this.services),\n\t\t\tnew Bullet(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.GRID,\n\t\t\t}),\n\t\t];\n\n\t\tconst components: any[] = this.getAxisChartComponents(\n\t\t\tgraphFrameComponents\n\t\t);\n\t\treturn components;\n\t}\n}\n"]}
|
package/charts/radar.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { RadarChartModel } from '../model/radar';
|
|
1
2
|
import { Chart } from '../chart';
|
|
2
3
|
import { ChartConfig, RadarChartOptions } from '../interfaces/index';
|
|
3
4
|
export declare class RadarChart extends Chart {
|
|
4
|
-
|
|
5
|
+
model: RadarChartModel;
|
|
6
|
+
constructor(holder: Element, chartConfigs: ChartConfig<RadarChartOptions>);
|
|
5
7
|
getComponents(): any[];
|
|
6
8
|
}
|
package/charts/radar.js
CHANGED
|
@@ -12,20 +12,16 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
14
|
// Internal Imports
|
|
15
|
+
import { RadarChartModel } from '../model/radar';
|
|
15
16
|
import { Chart } from '../chart';
|
|
16
17
|
import * as Configuration from '../configuration';
|
|
17
18
|
import { Tools } from '../tools';
|
|
18
19
|
import { Radar } from '../components/graphs/radar';
|
|
19
20
|
var RadarChart = /** @class */ (function (_super) {
|
|
20
21
|
__extends(RadarChart, _super);
|
|
21
|
-
|
|
22
|
-
function RadarChart(holder, chartConfigs, extending) {
|
|
23
|
-
if (extending === void 0) { extending = false; }
|
|
22
|
+
function RadarChart(holder, chartConfigs) {
|
|
24
23
|
var _this = _super.call(this, holder, chartConfigs) || this;
|
|
25
|
-
|
|
26
|
-
if (extending) {
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
24
|
+
_this.model = new RadarChartModel(_this.services);
|
|
29
25
|
// Merge the default options for this chart
|
|
30
26
|
// With the user provided options
|
|
31
27
|
_this.model.setOptions(Tools.mergeDefaultChartOptions(Configuration.options.radarChart, chartConfigs.options));
|
package/charts/radar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radar.js","sourceRoot":"","sources":["radar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAQjC,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;IAAgC,8BAAK;
|
|
1
|
+
{"version":3,"file":"radar.js","sourceRoot":"","sources":["radar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAQjC,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;IAAgC,8BAAK;IAGpC,oBAAY,MAAe,EAAE,YAA4C;QAAzE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAa3B;QAhBD,WAAK,GAAG,IAAI,eAAe,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAK1C,2CAA2C;QAC3C,iCAAiC;QACjC,KAAI,CAAC,KAAK,CAAC,UAAU,CACpB,KAAK,CAAC,wBAAwB,CAC7B,aAAa,CAAC,OAAO,CAAC,UAAU,EAChC,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QAEF,6CAA6C;QAC7C,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;IACjC,CAAC;IAED,kCAAa,GAAb;QACC,gDAAgD;QAChD,IAAM,oBAAoB,GAAU;YACnC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;SACpC,CAAC;QAEF,wDAAwD;QACxD,IAAM,UAAU,GAAU,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;QACxE,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,iBAAC;AAAD,CAAC,AA7BD,CAAgC,KAAK,GA6BpC","sourcesContent":["// Internal Imports\nimport { RadarChartModel } from '../model/radar';\nimport { Chart } from '../chart';\nimport * as Configuration from '../configuration';\nimport { ChartConfig, RadarChartOptions } from '../interfaces/index';\nimport { Tools } from '../tools';\n\n// Components\nimport {\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tLegend,\n\tLayoutComponent,\n} from '../components/index';\nimport { Radar } from '../components/graphs/radar';\n\nexport class RadarChart extends Chart {\n\tmodel = new RadarChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<RadarChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tTools.mergeDefaultChartOptions(\n\t\t\t\tConfiguration.options.radarChart,\n\t\t\t\tchartConfigs.options\n\t\t\t)\n\t\t);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: any[] = [\n\t\t\tnew Radar(this.model, this.services),\n\t\t];\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: any[] = this.getChartComponents(graphFrameComponents);\n\t\treturn components;\n\t}\n}\n"]}
|
package/charts/tree.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Chart } from '../chart';
|
|
2
|
+
import { TreeChartModel } from '../model/tree';
|
|
2
3
|
import { ChartConfig, TreeChartOptions } from '../interfaces/index';
|
|
3
4
|
export declare class TreeChart extends Chart {
|
|
5
|
+
model: TreeChartModel;
|
|
4
6
|
constructor(holder: Element, chartConfigs: ChartConfig<TreeChartOptions>);
|
|
5
7
|
getComponents(): any[];
|
|
6
8
|
}
|
package/charts/tree.js
CHANGED
|
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
})();
|
|
14
14
|
// Internal Imports
|
|
15
15
|
import { Chart } from '../chart';
|
|
16
|
+
import { TreeChartModel } from '../model/tree';
|
|
16
17
|
import * as Configuration from '../configuration';
|
|
17
18
|
import { Tools } from '../tools';
|
|
18
19
|
// Components
|
|
@@ -21,6 +22,7 @@ var TreeChart = /** @class */ (function (_super) {
|
|
|
21
22
|
__extends(TreeChart, _super);
|
|
22
23
|
function TreeChart(holder, chartConfigs) {
|
|
23
24
|
var _this = _super.call(this, holder, chartConfigs) || this;
|
|
25
|
+
_this.model = new TreeChartModel(_this.services);
|
|
24
26
|
// Merge the default options for this chart
|
|
25
27
|
// With the user provided options
|
|
26
28
|
_this.model.setOptions(Tools.mergeDefaultChartOptions(Configuration.options.treeChart, chartConfigs.options));
|
package/charts/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["tree.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EACN,IAAI,GAKJ,MAAM,qBAAqB,CAAC;AAE7B;IAA+B,6BAAK;
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["tree.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EACN,IAAI,GAKJ,MAAM,qBAAqB,CAAC;AAE7B;IAA+B,6BAAK;IAGnC,mBAAY,MAAe,EAAE,YAA2C;QAAxE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAa3B;QAhBD,WAAK,GAAG,IAAI,cAAc,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAKzC,2CAA2C;QAC3C,iCAAiC;QACjC,KAAI,CAAC,KAAK,CAAC,UAAU,CACpB,KAAK,CAAC,wBAAwB,CAC7B,aAAa,CAAC,OAAO,CAAC,SAAS,EAC/B,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QAEF,6CAA6C;QAC7C,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;IACjC,CAAC;IAED,iCAAa,GAAb;QACC,gDAAgD;QAChD,IAAM,oBAAoB,GAAU;YACnC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;SACnC,CAAC;QAEF,wDAAwD;QACxD,IAAM,UAAU,GAAU,IAAI,CAAC,kBAAkB,CAChD,oBAAoB,EACpB;YACC,aAAa,EAAE,IAAI;SACnB,CACD,CAAC;QACF,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,gBAAC;AAAD,CAAC,AAlCD,CAA+B,KAAK,GAkCnC","sourcesContent":["// Internal Imports\nimport { Chart } from '../chart';\nimport { TreeChartModel } from '../model/tree';\nimport * as Configuration from '../configuration';\nimport { ChartConfig, TreeChartOptions } from '../interfaces/index';\nimport { Tools } from '../tools';\n\n// Components\nimport {\n\tTree,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tLegend,\n\tLayoutComponent,\n\tSkeleton,\n} from '../components/index';\n\nexport class TreeChart extends Chart {\n\tmodel = new TreeChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<TreeChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tTools.mergeDefaultChartOptions(\n\t\t\t\tConfiguration.options.treeChart,\n\t\t\t\tchartConfigs.options\n\t\t\t)\n\t\t);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: any[] = [\n\t\t\tnew Tree(this.model, this.services),\n\t\t];\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: any[] = this.getChartComponents(\n\t\t\tgraphFrameComponents,\n\t\t\t{\n\t\t\t\texcludeLegend: true,\n\t\t\t}\n\t\t);\n\t\treturn components;\n\t}\n}\n"]}
|
package/charts/treemap.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Chart } from '../chart';
|
|
2
|
+
import { TreemapChartModel } from '../model/treemap';
|
|
2
3
|
import { ChartConfig, TreemapChartOptions } from '../interfaces/index';
|
|
3
4
|
export declare class TreemapChart extends Chart {
|
|
5
|
+
model: TreemapChartModel;
|
|
4
6
|
constructor(holder: Element, chartConfigs: ChartConfig<TreemapChartOptions>);
|
|
5
7
|
getComponents(): any[];
|
|
6
8
|
}
|
package/charts/treemap.js
CHANGED
|
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
})();
|
|
14
14
|
// Internal Imports
|
|
15
15
|
import { Chart } from '../chart';
|
|
16
|
+
import { TreemapChartModel } from '../model/treemap';
|
|
16
17
|
import * as Configuration from '../configuration';
|
|
17
18
|
import { Tools } from '../tools';
|
|
18
19
|
// Components
|
|
@@ -21,6 +22,7 @@ var TreemapChart = /** @class */ (function (_super) {
|
|
|
21
22
|
__extends(TreemapChart, _super);
|
|
22
23
|
function TreemapChart(holder, chartConfigs) {
|
|
23
24
|
var _this = _super.call(this, holder, chartConfigs) || this;
|
|
25
|
+
_this.model = new TreemapChartModel(_this.services);
|
|
24
26
|
// Merge the default options for this chart
|
|
25
27
|
// With the user provided options
|
|
26
28
|
_this.model.setOptions(Tools.mergeDefaultChartOptions(Configuration.options.treemapChart, chartConfigs.options));
|
package/charts/treemap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treemap.js","sourceRoot":"","sources":["treemap.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"treemap.js","sourceRoot":"","sources":["treemap.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EACN,OAAO,GAKP,MAAM,qBAAqB,CAAC;AAE7B;IAAkC,gCAAK;IAGtC,sBACC,MAAe,EACf,YAA8C;QAF/C,YAIC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAa3B;QAnBD,WAAK,GAAG,IAAI,iBAAiB,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAQ5C,2CAA2C;QAC3C,iCAAiC;QACjC,KAAI,CAAC,KAAK,CAAC,UAAU,CACpB,KAAK,CAAC,wBAAwB,CAC7B,aAAa,CAAC,OAAO,CAAC,YAAY,EAClC,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QAEF,6CAA6C;QAC7C,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;IACjC,CAAC;IAED,oCAAa,GAAb;QACC,gDAAgD;QAChD,IAAM,oBAAoB,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEtE,wDAAwD;QACxD,IAAM,UAAU,GAAU,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;QACxE,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,mBAAC;AAAD,CAAC,AA9BD,CAAkC,KAAK,GA8BtC","sourcesContent":["// Internal Imports\nimport { Chart } from '../chart';\nimport { TreemapChartModel } from '../model/treemap';\nimport { ChartConfig, TreemapChartOptions } from '../interfaces/index';\nimport * as Configuration from '../configuration';\nimport { Tools } from '../tools';\n\n// Components\nimport {\n\tTreemap,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tLegend,\n\tLayoutComponent,\n\tSkeleton,\n} from '../components/index';\n\nexport class TreemapChart extends Chart {\n\tmodel = new TreemapChartModel(this.services);\n\n\tconstructor(\n\t\tholder: Element,\n\t\tchartConfigs: ChartConfig<TreemapChartOptions>\n\t) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tTools.mergeDefaultChartOptions(\n\t\t\t\tConfiguration.options.treemapChart,\n\t\t\t\tchartConfigs.options\n\t\t\t)\n\t\t);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents = [new Treemap(this.model, this.services)];\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: any[] = this.getChartComponents(graphFrameComponents);\n\t\treturn components;\n\t}\n}\n"]}
|
package/charts/wordcloud.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { WordCloudModel } from '../model/wordcloud';
|
|
1
2
|
import { Chart } from '../chart';
|
|
2
3
|
import { ChartConfig, WorldCloudChartOptions } from '../interfaces/index';
|
|
3
4
|
export declare class WordCloudChart extends Chart {
|
|
5
|
+
model: WordCloudModel;
|
|
4
6
|
constructor(holder: Element, chartConfigs: ChartConfig<WorldCloudChartOptions>);
|
|
5
7
|
getComponents(): any[];
|
|
6
8
|
}
|
package/charts/wordcloud.js
CHANGED
|
@@ -11,6 +11,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
11
11
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
|
+
// Internal Imports
|
|
15
|
+
import { WordCloudModel } from '../model/wordcloud';
|
|
14
16
|
import { Chart } from '../chart';
|
|
15
17
|
import * as Configuration from '../configuration';
|
|
16
18
|
import { Tools } from '../tools';
|
|
@@ -21,6 +23,7 @@ var WordCloudChart = /** @class */ (function (_super) {
|
|
|
21
23
|
__extends(WordCloudChart, _super);
|
|
22
24
|
function WordCloudChart(holder, chartConfigs) {
|
|
23
25
|
var _this = _super.call(this, holder, chartConfigs) || this;
|
|
26
|
+
_this.model = new WordCloudModel(_this.services);
|
|
24
27
|
// Merge the default options for this chart
|
|
25
28
|
// With the user provided options
|
|
26
29
|
_this.model.setOptions(Tools.mergeDefaultChartOptions(Configuration.options.wordCloudChart, chartConfigs.options));
|
package/charts/wordcloud.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wordcloud.js","sourceRoot":"","sources":["wordcloud.ts"],"names":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"wordcloud.js","sourceRoot":"","sources":["wordcloud.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,aAAa;AACb,OAAO,EACN,SAAS,EAIT,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAE7B;IAAoC,kCAAK;IAGxC,wBACC,MAAe,EACf,YAAiD;QAFlD,YAIC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAa3B;QAnBD,WAAK,GAAG,IAAI,cAAc,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAQzC,2CAA2C;QAC3C,iCAAiC;QACjC,KAAI,CAAC,KAAK,CAAC,UAAU,CACpB,KAAK,CAAC,wBAAwB,CAC7B,aAAa,CAAC,OAAO,CAAC,cAAc,EACpC,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QAEF,6CAA6C;QAC7C,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;IACjC,CAAC;IAED,sCAAa,GAAb;QACC,gDAAgD;QAChD,IAAM,oBAAoB,GAAU;YACnC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACxC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE;gBACvC,QAAQ,EAAE,SAAS,CAAC,GAAG;aACvB,CAAC;SACF,CAAC;QAEF,wDAAwD;QACxD,IAAM,UAAU,GAAU,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;QACxE,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,qBAAC;AAAD,CAAC,AAnCD,CAAoC,KAAK,GAmCxC","sourcesContent":["// Internal Imports\nimport { WordCloudModel } from '../model/wordcloud';\nimport { Chart } from '../chart';\nimport * as Configuration from '../configuration';\nimport { ChartConfig, WorldCloudChartOptions } from '../interfaces/index';\nimport { Tools } from '../tools';\nimport { Skeletons } from '../interfaces/enums';\n\n// Components\nimport {\n\tWordCloud,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tLegend,\n\tLayoutComponent,\n\tSkeleton,\n} from '../components/index';\n\nexport class WordCloudChart extends Chart {\n\tmodel = new WordCloudModel(this.services);\n\n\tconstructor(\n\t\tholder: Element,\n\t\tchartConfigs: ChartConfig<WorldCloudChartOptions>\n\t) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tTools.mergeDefaultChartOptions(\n\t\t\t\tConfiguration.options.wordCloudChart,\n\t\t\t\tchartConfigs.options\n\t\t\t)\n\t\t);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: any[] = [\n\t\t\tnew WordCloud(this.model, this.services),\n\t\t\tnew Skeleton(this.model, this.services, {\n\t\t\t\tskeleton: Skeletons.PIE,\n\t\t\t}),\n\t\t];\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: any[] = this.getChartComponents(graphFrameComponents);\n\t\treturn components;\n\t}\n}\n"]}
|
|
@@ -10,6 +10,8 @@ export declare class Toolbar extends Component {
|
|
|
10
10
|
renderOverflowMenu(): void;
|
|
11
11
|
isOverflowMenuOpen(): any;
|
|
12
12
|
updateOverflowMenu(show: boolean): void;
|
|
13
|
+
focusOnPreviousEnabledToolbarItem(currentItemIndex: any): void;
|
|
14
|
+
focusOnNextEnabledToolbarItem(currentItemIndex: any): void;
|
|
13
15
|
focusOnPreviousEnabledMenuItem(currentItemIndex: any): void;
|
|
14
16
|
focusOnNextEnabledMenuItem(currentItemIndex: any): void;
|
|
15
17
|
toggleOverflowMenu(event: any): void;
|
|
@@ -20,9 +22,11 @@ export declare class Toolbar extends Component {
|
|
|
20
22
|
buttonList: any[];
|
|
21
23
|
overflowMenuItemList: any[];
|
|
22
24
|
};
|
|
25
|
+
getToolbarButtonItems(): any[];
|
|
23
26
|
getOverflowMenuItems(): any[];
|
|
24
27
|
getOverflowButtonConfig(): {
|
|
25
28
|
id: string;
|
|
29
|
+
title: string;
|
|
26
30
|
shouldBeDisabled: () => boolean;
|
|
27
31
|
iconSVGContent: string;
|
|
28
32
|
clickFunction: (event: any) => void;
|