billboard.js 3.3.0 → 3.3.1
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/dist/billboard.css +1 -1
- package/dist/billboard.js +424 -374
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2284 -2200
- package/dist/billboard.pkgd.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +137 -92
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +138 -93
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +3 -119
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +3 -119
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1862 -1828
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1998 -1919
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2000 -1921
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1866 -1948
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1866 -1948
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +426 -383
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +129 -77
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
- package/package.json +15 -15
- package/src/Chart/api/focus.ts +8 -8
- package/src/Chart/api/regions.ts +3 -3
- package/src/Chart/api/selection.ts +15 -15
- package/src/Chart/api/subchart.ts +3 -3
- package/src/ChartInternal/Axis/Axis.ts +13 -12
- package/src/ChartInternal/ChartInternal.ts +5 -6
- package/src/ChartInternal/data/data.ts +3 -3
- package/src/ChartInternal/data/load.ts +2 -2
- package/src/ChartInternal/interactions/drag.ts +15 -15
- package/src/ChartInternal/interactions/eventrect.ts +18 -18
- package/src/ChartInternal/interactions/interaction.ts +10 -10
- package/src/ChartInternal/interactions/zoom.ts +4 -4
- package/src/ChartInternal/internals/color.ts +4 -4
- package/src/ChartInternal/internals/domain.ts +1 -1
- package/src/ChartInternal/internals/grid.ts +32 -32
- package/src/ChartInternal/internals/legend.ts +27 -27
- package/src/ChartInternal/internals/redraw.ts +3 -3
- package/src/ChartInternal/internals/region.ts +3 -3
- package/src/ChartInternal/internals/selection.ts +16 -15
- package/src/ChartInternal/internals/size.ts +3 -3
- package/src/ChartInternal/internals/text.ts +8 -8
- package/src/ChartInternal/internals/title.ts +4 -4
- package/src/ChartInternal/internals/tooltip.ts +5 -5
- package/src/ChartInternal/internals/transform.ts +5 -5
- package/src/ChartInternal/shape/arc.ts +22 -22
- package/src/ChartInternal/shape/area.ts +4 -4
- package/src/ChartInternal/shape/bar.ts +7 -7
- package/src/ChartInternal/shape/candlestick.ts +8 -8
- package/src/ChartInternal/shape/gauge.ts +8 -8
- package/src/ChartInternal/shape/line.ts +7 -7
- package/src/ChartInternal/shape/point.ts +18 -18
- package/src/ChartInternal/shape/radar.ts +10 -10
- package/src/ChartInternal/shape/shape.ts +4 -2
- package/src/Plugin/sparkline/index.ts +2 -2
- package/src/Plugin/stanford/index.ts +3 -3
- package/src/Plugin/stanford/util.ts +0 -1
- package/src/config/classes.ts +154 -66
- package/src/module/util.ts +1 -2
package/dist-esm/billboard.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.3.
|
|
8
|
+
* @version 3.3.1
|
|
9
9
|
*/
|
|
10
10
|
import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
|
|
11
11
|
import { pointer, select, namespaces, selectAll } from 'd3-selection';
|
|
@@ -167,120 +167,6 @@ function __spreadArray(to, from, pack) {
|
|
|
167
167
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
/**
|
|
171
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
172
|
-
* billboard.js project is licensed under the MIT license
|
|
173
|
-
*/
|
|
174
|
-
/**
|
|
175
|
-
* CSS class names definition
|
|
176
|
-
* @private
|
|
177
|
-
*/
|
|
178
|
-
var CLASS = {
|
|
179
|
-
arc: "bb-arc",
|
|
180
|
-
arcLabelLine: "bb-arc-label-line",
|
|
181
|
-
arcs: "bb-arcs",
|
|
182
|
-
area: "bb-area",
|
|
183
|
-
areas: "bb-areas",
|
|
184
|
-
axis: "bb-axis",
|
|
185
|
-
axisX: "bb-axis-x",
|
|
186
|
-
axisXLabel: "bb-axis-x-label",
|
|
187
|
-
axisY: "bb-axis-y",
|
|
188
|
-
axisY2: "bb-axis-y2",
|
|
189
|
-
axisY2Label: "bb-axis-y2-label",
|
|
190
|
-
axisYLabel: "bb-axis-y-label",
|
|
191
|
-
bar: "bb-bar",
|
|
192
|
-
bars: "bb-bars",
|
|
193
|
-
brush: "bb-brush",
|
|
194
|
-
button: "bb-button",
|
|
195
|
-
buttonZoomReset: "bb-zoom-reset",
|
|
196
|
-
candlestick: "bb-candlestick",
|
|
197
|
-
candlesticks: "bb-candlesticks",
|
|
198
|
-
chart: "bb-chart",
|
|
199
|
-
chartArc: "bb-chart-arc",
|
|
200
|
-
chartArcs: "bb-chart-arcs",
|
|
201
|
-
chartArcsBackground: "bb-chart-arcs-background",
|
|
202
|
-
chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
|
203
|
-
chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
|
204
|
-
chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
|
|
205
|
-
chartArcsTitle: "bb-chart-arcs-title",
|
|
206
|
-
chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
|
|
207
|
-
chartBar: "bb-chart-bar",
|
|
208
|
-
chartBars: "bb-chart-bars",
|
|
209
|
-
chartCandlestick: "bb-chart-candlestick",
|
|
210
|
-
chartCandlesticks: "bb-chart-candlesticks",
|
|
211
|
-
chartCircles: "bb-chart-circles",
|
|
212
|
-
chartLine: "bb-chart-line",
|
|
213
|
-
chartLines: "bb-chart-lines",
|
|
214
|
-
chartRadar: "bb-chart-radar",
|
|
215
|
-
chartRadars: "bb-chart-radars",
|
|
216
|
-
chartText: "bb-chart-text",
|
|
217
|
-
chartTexts: "bb-chart-texts",
|
|
218
|
-
circle: "bb-circle",
|
|
219
|
-
circles: "bb-circles",
|
|
220
|
-
colorPattern: "bb-color-pattern",
|
|
221
|
-
colorScale: "bb-colorscale",
|
|
222
|
-
defocused: "bb-defocused",
|
|
223
|
-
dragarea: "bb-dragarea",
|
|
224
|
-
empty: "bb-empty",
|
|
225
|
-
eventRect: "bb-event-rect",
|
|
226
|
-
eventRects: "bb-event-rects",
|
|
227
|
-
eventRectsMultiple: "bb-event-rects-multiple",
|
|
228
|
-
eventRectsSingle: "bb-event-rects-single",
|
|
229
|
-
focused: "bb-focused",
|
|
230
|
-
gaugeValue: "bb-gauge-value",
|
|
231
|
-
grid: "bb-grid",
|
|
232
|
-
gridLines: "bb-grid-lines",
|
|
233
|
-
legend: "bb-legend",
|
|
234
|
-
legendBackground: "bb-legend-background",
|
|
235
|
-
legendItem: "bb-legend-item",
|
|
236
|
-
legendItemEvent: "bb-legend-item-event",
|
|
237
|
-
legendItemFocused: "bb-legend-item-focused",
|
|
238
|
-
legendItemHidden: "bb-legend-item-hidden",
|
|
239
|
-
legendItemPoint: "bb-legend-item-point",
|
|
240
|
-
legendItemTile: "bb-legend-item-tile",
|
|
241
|
-
level: "bb-level",
|
|
242
|
-
levels: "bb-levels",
|
|
243
|
-
line: "bb-line",
|
|
244
|
-
lines: "bb-lines",
|
|
245
|
-
main: "bb-main",
|
|
246
|
-
region: "bb-region",
|
|
247
|
-
regions: "bb-regions",
|
|
248
|
-
selectedCircle: "bb-selected-circle",
|
|
249
|
-
selectedCircles: "bb-selected-circles",
|
|
250
|
-
shape: "bb-shape",
|
|
251
|
-
shapes: "bb-shapes",
|
|
252
|
-
stanfordElements: "bb-stanford-elements",
|
|
253
|
-
stanfordLine: "bb-stanford-line",
|
|
254
|
-
stanfordLines: "bb-stanford-lines",
|
|
255
|
-
stanfordRegion: "bb-stanford-region",
|
|
256
|
-
stanfordRegions: "bb-stanford-regions",
|
|
257
|
-
subchart: "bb-subchart",
|
|
258
|
-
target: "bb-target",
|
|
259
|
-
text: "bb-text",
|
|
260
|
-
texts: "bb-texts",
|
|
261
|
-
title: "bb-title",
|
|
262
|
-
tooltip: "bb-tooltip",
|
|
263
|
-
tooltipContainer: "bb-tooltip-container",
|
|
264
|
-
tooltipName: "bb-tooltip-name",
|
|
265
|
-
valueDown: "bb-value-down",
|
|
266
|
-
valueUp: "bb-value-up",
|
|
267
|
-
xgrid: "bb-xgrid",
|
|
268
|
-
xgridFocus: "bb-xgrid-focus",
|
|
269
|
-
xgridLine: "bb-xgrid-line",
|
|
270
|
-
xgridLines: "bb-xgrid-lines",
|
|
271
|
-
xgrids: "bb-xgrids",
|
|
272
|
-
ygrid: "bb-ygrid",
|
|
273
|
-
ygridFocus: "bb-ygrid-focus",
|
|
274
|
-
ygridLine: "bb-ygrid-line",
|
|
275
|
-
ygridLines: "bb-ygrid-lines",
|
|
276
|
-
ygrids: "bb-ygrids",
|
|
277
|
-
zoomBrush: "bb-zoom-brush",
|
|
278
|
-
EXPANDED: "_expanded_",
|
|
279
|
-
SELECTED: "_selected_",
|
|
280
|
-
INCLUDED: "_included_",
|
|
281
|
-
TextOverlapping: "text-overlapping"
|
|
282
|
-
};
|
|
283
|
-
|
|
284
170
|
var isValue = function (v) { return v || v === 0; };
|
|
285
171
|
var isFunction = function (v) { return typeof v === "function"; };
|
|
286
172
|
var isString = function (v) { return typeof v === "string"; };
|
|
@@ -489,7 +375,7 @@ function getBrushSelection(ctx) {
|
|
|
489
375
|
selection = event.selection;
|
|
490
376
|
// check from brush area selection
|
|
491
377
|
}
|
|
492
|
-
else if (main && (selection = main.select("."
|
|
378
|
+
else if (main && (selection = main.select(".bb-brush").node())) {
|
|
493
379
|
selection = brushSelection(selection);
|
|
494
380
|
}
|
|
495
381
|
return selection;
|
|
@@ -934,6 +820,160 @@ function logError(head, tail) {
|
|
|
934
820
|
throw Error("".concat(prefix, " ").concat(head.replace(/\%c([a-z-]+)/i, "'$1' "), " ").concat(tail));
|
|
935
821
|
}
|
|
936
822
|
|
|
823
|
+
/**
|
|
824
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
825
|
+
* billboard.js project is licensed under the MIT license
|
|
826
|
+
*/
|
|
827
|
+
/**
|
|
828
|
+
* CSS class names definition
|
|
829
|
+
* @private
|
|
830
|
+
*/
|
|
831
|
+
var $COMMON = {
|
|
832
|
+
button: "bb-button",
|
|
833
|
+
chart: "bb-chart",
|
|
834
|
+
empty: "bb-empty",
|
|
835
|
+
main: "bb-main",
|
|
836
|
+
target: "bb-target",
|
|
837
|
+
EXPANDED: "_expanded_"
|
|
838
|
+
};
|
|
839
|
+
var $ARC = {
|
|
840
|
+
arc: "bb-arc",
|
|
841
|
+
arcLabelLine: "bb-arc-label-line",
|
|
842
|
+
arcs: "bb-arcs",
|
|
843
|
+
chartArc: "bb-chart-arc",
|
|
844
|
+
chartArcs: "bb-chart-arcs",
|
|
845
|
+
chartArcsBackground: "bb-chart-arcs-background",
|
|
846
|
+
chartArcsTitle: "bb-chart-arcs-title"
|
|
847
|
+
};
|
|
848
|
+
var $AREA = {
|
|
849
|
+
area: "bb-area",
|
|
850
|
+
areas: "bb-areas"
|
|
851
|
+
};
|
|
852
|
+
var $AXIS = {
|
|
853
|
+
axis: "bb-axis",
|
|
854
|
+
axisX: "bb-axis-x",
|
|
855
|
+
axisXLabel: "bb-axis-x-label",
|
|
856
|
+
axisY: "bb-axis-y",
|
|
857
|
+
axisY2: "bb-axis-y2",
|
|
858
|
+
axisY2Label: "bb-axis-y2-label",
|
|
859
|
+
axisYLabel: "bb-axis-y-label"
|
|
860
|
+
};
|
|
861
|
+
var $BAR = {
|
|
862
|
+
bar: "bb-bar",
|
|
863
|
+
bars: "bb-bars",
|
|
864
|
+
chartBar: "bb-chart-bar",
|
|
865
|
+
chartBars: "bb-chart-bars"
|
|
866
|
+
};
|
|
867
|
+
var $CANDLESTICK = {
|
|
868
|
+
candlestick: "bb-candlestick",
|
|
869
|
+
candlesticks: "bb-candlesticks",
|
|
870
|
+
chartCandlestick: "bb-chart-candlestick",
|
|
871
|
+
chartCandlesticks: "bb-chart-candlesticks",
|
|
872
|
+
valueDown: "bb-value-down",
|
|
873
|
+
valueUp: "bb-value-up"
|
|
874
|
+
};
|
|
875
|
+
var $CIRCLE = {
|
|
876
|
+
chartCircles: "bb-chart-circles",
|
|
877
|
+
circle: "bb-circle",
|
|
878
|
+
circles: "bb-circles"
|
|
879
|
+
};
|
|
880
|
+
var $COLOR = {
|
|
881
|
+
colorPattern: "bb-color-pattern",
|
|
882
|
+
colorScale: "bb-colorscale"
|
|
883
|
+
};
|
|
884
|
+
var $DRAG = {
|
|
885
|
+
dragarea: "bb-dragarea",
|
|
886
|
+
INCLUDED: "_included_"
|
|
887
|
+
};
|
|
888
|
+
var $GAUGE = {
|
|
889
|
+
chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
|
890
|
+
chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
|
891
|
+
chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
|
|
892
|
+
chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
|
|
893
|
+
gaugeValue: "bb-gauge-value"
|
|
894
|
+
};
|
|
895
|
+
var $LEGEND = {
|
|
896
|
+
legend: "bb-legend",
|
|
897
|
+
legendBackground: "bb-legend-background",
|
|
898
|
+
legendItem: "bb-legend-item",
|
|
899
|
+
legendItemEvent: "bb-legend-item-event",
|
|
900
|
+
legendItemHidden: "bb-legend-item-hidden",
|
|
901
|
+
legendItemPoint: "bb-legend-item-point",
|
|
902
|
+
legendItemTile: "bb-legend-item-tile"
|
|
903
|
+
};
|
|
904
|
+
var $LINE = {
|
|
905
|
+
chartLine: "bb-chart-line",
|
|
906
|
+
chartLines: "bb-chart-lines",
|
|
907
|
+
line: "bb-line",
|
|
908
|
+
lines: "bb-lines"
|
|
909
|
+
};
|
|
910
|
+
var $EVENT = {
|
|
911
|
+
eventRect: "bb-event-rect",
|
|
912
|
+
eventRects: "bb-event-rects",
|
|
913
|
+
eventRectsMultiple: "bb-event-rects-multiple",
|
|
914
|
+
eventRectsSingle: "bb-event-rects-single"
|
|
915
|
+
};
|
|
916
|
+
var $FOCUS = {
|
|
917
|
+
focused: "bb-focused",
|
|
918
|
+
defocused: "bb-defocused",
|
|
919
|
+
legendItemFocused: "bb-legend-item-focused",
|
|
920
|
+
xgridFocus: "bb-xgrid-focus",
|
|
921
|
+
ygridFocus: "bb-ygrid-focus"
|
|
922
|
+
};
|
|
923
|
+
var $GRID = {
|
|
924
|
+
grid: "bb-grid",
|
|
925
|
+
gridLines: "bb-grid-lines",
|
|
926
|
+
xgrid: "bb-xgrid",
|
|
927
|
+
xgridLine: "bb-xgrid-line",
|
|
928
|
+
xgridLines: "bb-xgrid-lines",
|
|
929
|
+
xgrids: "bb-xgrids",
|
|
930
|
+
ygrid: "bb-ygrid",
|
|
931
|
+
ygridLine: "bb-ygrid-line",
|
|
932
|
+
ygridLines: "bb-ygrid-lines",
|
|
933
|
+
ygrids: "bb-ygrids"
|
|
934
|
+
};
|
|
935
|
+
var $RADAR = {
|
|
936
|
+
chartRadar: "bb-chart-radar",
|
|
937
|
+
chartRadars: "bb-chart-radars",
|
|
938
|
+
level: "bb-level",
|
|
939
|
+
levels: "bb-levels"
|
|
940
|
+
};
|
|
941
|
+
var $REGION = {
|
|
942
|
+
region: "bb-region",
|
|
943
|
+
regions: "bb-regions"
|
|
944
|
+
};
|
|
945
|
+
var $SELECT = {
|
|
946
|
+
selectedCircle: "bb-selected-circle",
|
|
947
|
+
selectedCircles: "bb-selected-circles",
|
|
948
|
+
SELECTED: "_selected_"
|
|
949
|
+
};
|
|
950
|
+
var $SHAPE = {
|
|
951
|
+
shape: "bb-shape",
|
|
952
|
+
shapes: "bb-shapes"
|
|
953
|
+
};
|
|
954
|
+
var $SUBCHART = {
|
|
955
|
+
brush: "bb-brush",
|
|
956
|
+
subchart: "bb-subchart"
|
|
957
|
+
};
|
|
958
|
+
var $TEXT = {
|
|
959
|
+
chartText: "bb-chart-text",
|
|
960
|
+
chartTexts: "bb-chart-texts",
|
|
961
|
+
text: "bb-text",
|
|
962
|
+
texts: "bb-texts",
|
|
963
|
+
title: "bb-title",
|
|
964
|
+
TextOverlapping: "text-overlapping"
|
|
965
|
+
};
|
|
966
|
+
var $TOOLTIP = {
|
|
967
|
+
tooltip: "bb-tooltip",
|
|
968
|
+
tooltipContainer: "bb-tooltip-container",
|
|
969
|
+
tooltipName: "bb-tooltip-name"
|
|
970
|
+
};
|
|
971
|
+
var $ZOOM = {
|
|
972
|
+
buttonZoomReset: "bb-zoom-reset",
|
|
973
|
+
zoomBrush: "bb-zoom-brush"
|
|
974
|
+
};
|
|
975
|
+
var CLASS = _assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $ZOOM);
|
|
976
|
+
|
|
937
977
|
/**
|
|
938
978
|
* Elements class.
|
|
939
979
|
* @class Elements
|
|
@@ -3899,8 +3939,8 @@ var data$1 = {
|
|
|
3899
3939
|
.filter(function (v) { return $$.isBarType(v.id) || $$.isCandlestickType(v.id); })
|
|
3900
3940
|
.forEach(function (v) {
|
|
3901
3941
|
var selector = $$.isBarType(v.id) ?
|
|
3902
|
-
".".concat(
|
|
3903
|
-
".".concat(
|
|
3942
|
+
".".concat($BAR.chartBar, ".").concat($COMMON.target).concat($$.getTargetSelectorSuffix(v.id), " .").concat($BAR.bar, "-").concat(v.index) :
|
|
3943
|
+
".".concat($CANDLESTICK.chartCandlestick, ".").concat($COMMON.target).concat($$.getTargetSelectorSuffix(v.id), " .").concat($CANDLESTICK.candlestick, "-").concat(v.index, " path");
|
|
3904
3944
|
if (!closest && $$.isWithinBar(main.select(selector).node())) {
|
|
3905
3945
|
closest = v;
|
|
3906
3946
|
}
|
|
@@ -4203,7 +4243,7 @@ var dataLoad = {
|
|
|
4203
4243
|
state.withoutFadeIn[id] = false;
|
|
4204
4244
|
// Remove target's elements
|
|
4205
4245
|
if ($el.legend) {
|
|
4206
|
-
$el.legend.selectAll(".".concat(
|
|
4246
|
+
$el.legend.selectAll(".".concat($LEGEND.legendItem).concat($$.getTargetSelectorSuffix(id))).remove();
|
|
4207
4247
|
}
|
|
4208
4248
|
// Remove target
|
|
4209
4249
|
$$.data.targets = $$.data.targets.filter(function (t) { return t.id !== id; });
|
|
@@ -4234,10 +4274,10 @@ var interaction = {
|
|
|
4234
4274
|
return;
|
|
4235
4275
|
}
|
|
4236
4276
|
}
|
|
4237
|
-
main.selectAll(".".concat(
|
|
4277
|
+
main.selectAll(".".concat($SHAPE.shape, "-").concat(index))
|
|
4238
4278
|
.each(function () {
|
|
4239
4279
|
var _a;
|
|
4240
|
-
select(this).classed(
|
|
4280
|
+
select(this).classed($COMMON.EXPANDED, true);
|
|
4241
4281
|
if (isSelectionEnabled) {
|
|
4242
4282
|
eventRect.style("cursor", isSelectionGrouped ? "pointer" : null);
|
|
4243
4283
|
}
|
|
@@ -4294,8 +4334,8 @@ var interaction = {
|
|
|
4294
4334
|
["bar", "candlestick"]
|
|
4295
4335
|
.filter(function (v) { return $$.$el[v]; })
|
|
4296
4336
|
.forEach(function (v) {
|
|
4297
|
-
reset && $$.$el[v].classed(
|
|
4298
|
-
$$.getShapeByIndex(v, i, id).classed(
|
|
4337
|
+
reset && $$.$el[v].classed($COMMON.EXPANDED, false);
|
|
4338
|
+
$$.getShapeByIndex(v, i, id).classed($COMMON.EXPANDED, expand);
|
|
4299
4339
|
});
|
|
4300
4340
|
},
|
|
4301
4341
|
/**
|
|
@@ -4313,11 +4353,11 @@ var interaction = {
|
|
|
4313
4353
|
var callback_1 = config[isOver ? "data_onover" : "data_onout"].bind($$.api);
|
|
4314
4354
|
config.color_onover && $$.setOverColor(isOver, d, isArc);
|
|
4315
4355
|
if (isArc) {
|
|
4316
|
-
callback_1(d, main.select(".".concat(
|
|
4356
|
+
callback_1(d, main.select(".".concat($ARC.arc).concat($$.getTargetSelectorSuffix(d.id))).node());
|
|
4317
4357
|
}
|
|
4318
4358
|
else if (!config.tooltip_grouped) {
|
|
4319
4359
|
var last_1 = $$.cache.get(KEY.setOverOut) || [];
|
|
4320
|
-
var shape = main.selectAll(".".concat(
|
|
4360
|
+
var shape = main.selectAll(".".concat($SHAPE.shape, "-").concat(d))
|
|
4321
4361
|
.filter(function (d) {
|
|
4322
4362
|
return $$.isWithinShape(this, d);
|
|
4323
4363
|
});
|
|
@@ -4342,7 +4382,7 @@ var interaction = {
|
|
|
4342
4382
|
$$.showCircleFocus($$.getAllValuesOnIndex(d, true)) :
|
|
4343
4383
|
$$.setExpand(d, null, true);
|
|
4344
4384
|
}
|
|
4345
|
-
!$$.isMultipleX() && main.selectAll(".".concat(
|
|
4385
|
+
!$$.isMultipleX() && main.selectAll(".".concat($SHAPE.shape, "-").concat(d))
|
|
4346
4386
|
.each(function (d) {
|
|
4347
4387
|
callback_1(d, this);
|
|
4348
4388
|
});
|
|
@@ -4397,7 +4437,7 @@ var interaction = {
|
|
|
4397
4437
|
var $$ = this;
|
|
4398
4438
|
var config = $$.config, _a = $$.state, eventReceiver = _a.eventReceiver, hasAxis = _a.hasAxis, hasRadar = _a.hasRadar, _b = $$.$el, eventRect = _b.eventRect, arcs = _b.arcs, radar = _b.radar;
|
|
4399
4439
|
var isMultipleX = $$.isMultipleX();
|
|
4400
|
-
var element = (hasRadar ? radar.axes.select(".".concat(
|
|
4440
|
+
var element = (hasRadar ? radar.axes.select(".".concat($AXIS.axis, "-").concat(index, " text")) : (eventRect || arcs.selectAll(".".concat($COMMON.target, " path")).filter(function (d, i) { return i === index; }))).node();
|
|
4401
4441
|
var _c = element.getBoundingClientRect(), width = _c.width, left = _c.left, top = _c.top;
|
|
4402
4442
|
if (hasAxis && !hasRadar && !isMultipleX) {
|
|
4403
4443
|
var coords = eventReceiver.coords[index];
|
|
@@ -4616,7 +4656,7 @@ var color = {
|
|
|
4616
4656
|
if (!pattern) {
|
|
4617
4657
|
var delimiter = ";";
|
|
4618
4658
|
var span = doc.createElement("span");
|
|
4619
|
-
span.className =
|
|
4659
|
+
span.className = $COLOR.colorPattern;
|
|
4620
4660
|
span.style.display = "none";
|
|
4621
4661
|
body.appendChild(span);
|
|
4622
4662
|
var content = win.getComputedStyle(span).backgroundImage;
|
|
@@ -4753,8 +4793,8 @@ var color = {
|
|
|
4753
4793
|
}
|
|
4754
4794
|
main.selectAll(isObject(d) ?
|
|
4755
4795
|
// when is Arc type
|
|
4756
|
-
".".concat(
|
|
4757
|
-
".".concat(
|
|
4796
|
+
".".concat($ARC.arc).concat($$.getTargetSelectorSuffix(d.id)) :
|
|
4797
|
+
".".concat($SHAPE.shape, "-").concat(d)).style("fill", color);
|
|
4758
4798
|
}
|
|
4759
4799
|
};
|
|
4760
4800
|
|
|
@@ -4842,7 +4882,7 @@ var domain = {
|
|
|
4842
4882
|
var yDomainMax = $$.getYDomainMinMax(yTargets, "max");
|
|
4843
4883
|
var isZeroBased = __spreadArray([TYPE.BAR, TYPE.BUBBLE, TYPE.SCATTER], TYPE_BY_CATEGORY.Line, true).some(function (v) {
|
|
4844
4884
|
var type = v.indexOf("area") > -1 ? "area" : v;
|
|
4845
|
-
return $$.hasType(v, yTargets) && config["".concat(type, "_zerobased")];
|
|
4885
|
+
return $$.hasType(v, yTargets, true) && config["".concat(type, "_zerobased")];
|
|
4846
4886
|
});
|
|
4847
4887
|
// MEMO: avoid inverting domain unexpectedly
|
|
4848
4888
|
yDomainMin = isValue(yMin) ? yMin :
|
|
@@ -5161,7 +5201,7 @@ var legend$1 = {
|
|
|
5161
5201
|
if (config.legend_show) {
|
|
5162
5202
|
if (!config.legend_contents_bindto) {
|
|
5163
5203
|
$el.legend = $$.$el.svg.append("g")
|
|
5164
|
-
.classed(
|
|
5204
|
+
.classed($LEGEND.legend, true)
|
|
5165
5205
|
.attr("transform", $$.getTranslate("legend"));
|
|
5166
5206
|
}
|
|
5167
5207
|
// MEMO: call here to update legend box and translate for all
|
|
@@ -5196,8 +5236,8 @@ var legend$1 = {
|
|
|
5196
5236
|
$$.updateLegendElement(targetIds || $$.mapToIds($$.data.targets), optionz, transitions);
|
|
5197
5237
|
}
|
|
5198
5238
|
// toggle legend state
|
|
5199
|
-
$el.legend.selectAll(".".concat(
|
|
5200
|
-
.classed(
|
|
5239
|
+
$el.legend.selectAll(".".concat($LEGEND.legendItem))
|
|
5240
|
+
.classed($LEGEND.legendItemHidden, function (id) {
|
|
5201
5241
|
var hide = !$$.isTargetToShow(id);
|
|
5202
5242
|
if (hide) {
|
|
5203
5243
|
this.style.opacity = null;
|
|
@@ -5313,7 +5353,7 @@ var legend$1 = {
|
|
|
5313
5353
|
updateLegendItemColor: function (id, color) {
|
|
5314
5354
|
var legend = this.$el.legend;
|
|
5315
5355
|
if (legend) {
|
|
5316
|
-
legend.select(".".concat(
|
|
5356
|
+
legend.select(".".concat($LEGEND.legendItem, "-").concat(id, " line"))
|
|
5317
5357
|
.style("stroke", color);
|
|
5318
5358
|
}
|
|
5319
5359
|
},
|
|
@@ -5346,7 +5386,7 @@ var legend$1 = {
|
|
|
5346
5386
|
* @private
|
|
5347
5387
|
*/
|
|
5348
5388
|
opacityForUnfocusedLegend: function (legendItem) {
|
|
5349
|
-
return legendItem.classed(
|
|
5389
|
+
return legendItem.classed($LEGEND.legendItemHidden) ? null : "0.3";
|
|
5350
5390
|
},
|
|
5351
5391
|
/**
|
|
5352
5392
|
* Toggles the focus of the legend
|
|
@@ -5358,9 +5398,9 @@ var legend$1 = {
|
|
|
5358
5398
|
var $$ = this;
|
|
5359
5399
|
var legend = $$.$el.legend, $T = $$.$T;
|
|
5360
5400
|
var targetIdz = $$.mapToTargetIds(targetIds);
|
|
5361
|
-
legend && $T(legend.selectAll(".".concat(
|
|
5401
|
+
legend && $T(legend.selectAll(".".concat($LEGEND.legendItem))
|
|
5362
5402
|
.filter(function (id) { return targetIdz.indexOf(id) >= 0; })
|
|
5363
|
-
.classed(
|
|
5403
|
+
.classed($FOCUS.legendItemFocused, focus))
|
|
5364
5404
|
.style("opacity", function () {
|
|
5365
5405
|
return focus ? null :
|
|
5366
5406
|
$$.opacityForUnfocusedLegend.call($$, select(this));
|
|
@@ -5373,8 +5413,8 @@ var legend$1 = {
|
|
|
5373
5413
|
revertLegend: function () {
|
|
5374
5414
|
var $$ = this;
|
|
5375
5415
|
var legend = $$.$el.legend, $T = $$.$T;
|
|
5376
|
-
legend && $T(legend.selectAll(".".concat(
|
|
5377
|
-
.classed(
|
|
5416
|
+
legend && $T(legend.selectAll(".".concat($LEGEND.legendItem))
|
|
5417
|
+
.classed($FOCUS.legendItemFocused, false))
|
|
5378
5418
|
.style("opacity", null);
|
|
5379
5419
|
},
|
|
5380
5420
|
/**
|
|
@@ -5429,7 +5469,7 @@ var legend$1 = {
|
|
|
5429
5469
|
if (id) {
|
|
5430
5470
|
data = (!state.redrawing && cache.get(cacheKey)) || {};
|
|
5431
5471
|
if (!data[id]) {
|
|
5432
|
-
data[id] = $$.getTextRect(textElement,
|
|
5472
|
+
data[id] = $$.getTextRect(textElement, $LEGEND.legendItem);
|
|
5433
5473
|
cache.add(cacheKey, data);
|
|
5434
5474
|
}
|
|
5435
5475
|
data = data[id];
|
|
@@ -5450,7 +5490,7 @@ var legend$1 = {
|
|
|
5450
5490
|
.attr("class", function (id) {
|
|
5451
5491
|
var node = select(this);
|
|
5452
5492
|
var itemClass = (!node.empty() && node.attr("class")) || "";
|
|
5453
|
-
return itemClass + $$.generateClass(
|
|
5493
|
+
return itemClass + $$.generateClass($LEGEND.legendItem, id);
|
|
5454
5494
|
})
|
|
5455
5495
|
.style("visibility", function (id) { return ($$.isLegendToShow(id) ? null : "hidden"); });
|
|
5456
5496
|
if (config.interaction_enabled) {
|
|
@@ -5465,7 +5505,7 @@ var legend$1 = {
|
|
|
5465
5505
|
else {
|
|
5466
5506
|
api.toggle(id);
|
|
5467
5507
|
select(this)
|
|
5468
|
-
.classed(
|
|
5508
|
+
.classed($FOCUS.legendItemFocused, false);
|
|
5469
5509
|
}
|
|
5470
5510
|
}
|
|
5471
5511
|
isTouch && $$.hideTooltip();
|
|
@@ -5473,18 +5513,18 @@ var legend$1 = {
|
|
|
5473
5513
|
!isTouch && item
|
|
5474
5514
|
.on("mouseout", function (event, id) {
|
|
5475
5515
|
if (!callFn(config.legend_item_onout, api, id)) {
|
|
5476
|
-
select(this).classed(
|
|
5516
|
+
select(this).classed($FOCUS.legendItemFocused, false);
|
|
5477
5517
|
if (hasGauge) {
|
|
5478
|
-
$$.undoMarkOverlapped($$, ".".concat(
|
|
5518
|
+
$$.undoMarkOverlapped($$, ".".concat($GAUGE.gaugeValue));
|
|
5479
5519
|
}
|
|
5480
5520
|
$$.api.revert();
|
|
5481
5521
|
}
|
|
5482
5522
|
})
|
|
5483
5523
|
.on("mouseover", function (event, id) {
|
|
5484
5524
|
if (!callFn(config.legend_item_onover, api, id)) {
|
|
5485
|
-
select(this).classed(
|
|
5525
|
+
select(this).classed($FOCUS.legendItemFocused, true);
|
|
5486
5526
|
if (hasGauge) {
|
|
5487
|
-
$$.markOverlapped(id, $$, ".".concat(
|
|
5527
|
+
$$.markOverlapped(id, $$, ".".concat($GAUGE.gaugeValue));
|
|
5488
5528
|
}
|
|
5489
5529
|
if (!state.transiting && $$.isTargetToShow(id)) {
|
|
5490
5530
|
api.focus(id);
|
|
@@ -5612,7 +5652,7 @@ var legend$1 = {
|
|
|
5612
5652
|
var yForLegendTile = function (id, i) { return yForLegend(id, i) + 4; };
|
|
5613
5653
|
var pos = -200;
|
|
5614
5654
|
// Define g for legend area
|
|
5615
|
-
var l = legend.selectAll(".".concat(
|
|
5655
|
+
var l = legend.selectAll(".".concat($LEGEND.legendItem))
|
|
5616
5656
|
.data(targetIdz)
|
|
5617
5657
|
.enter()
|
|
5618
5658
|
.append("g");
|
|
@@ -5626,7 +5666,7 @@ var legend$1 = {
|
|
|
5626
5666
|
.attr("x", isLegendRightOrInset ? xForLegendText : pos)
|
|
5627
5667
|
.attr("y", isLegendRightOrInset ? pos : yForLegendText);
|
|
5628
5668
|
l.append("rect")
|
|
5629
|
-
.attr("class",
|
|
5669
|
+
.attr("class", $LEGEND.legendItemEvent)
|
|
5630
5670
|
.style("fill-opacity", "0")
|
|
5631
5671
|
.attr("x", isLegendRightOrInset ? xForLegendRect : pos)
|
|
5632
5672
|
.attr("y", isLegendRightOrInset ? pos : yForLegendRect);
|
|
@@ -5649,7 +5689,7 @@ var legend$1 = {
|
|
|
5649
5689
|
}
|
|
5650
5690
|
return doc.createElementNS(namespaces.svg, ("hasValidPointType" in $$) && $$.hasValidPointType(point) ? point : "use");
|
|
5651
5691
|
})
|
|
5652
|
-
.attr("class",
|
|
5692
|
+
.attr("class", $LEGEND.legendItemPoint)
|
|
5653
5693
|
.style("fill", getColor)
|
|
5654
5694
|
.style("pointer-events", "none")
|
|
5655
5695
|
.attr("href", function (data, idx, selection) {
|
|
@@ -5661,7 +5701,7 @@ var legend$1 = {
|
|
|
5661
5701
|
}
|
|
5662
5702
|
else {
|
|
5663
5703
|
l.append("line")
|
|
5664
|
-
.attr("class",
|
|
5704
|
+
.attr("class", $LEGEND.legendItemTile)
|
|
5665
5705
|
.style("stroke", getColor)
|
|
5666
5706
|
.style("pointer-events", "none")
|
|
5667
5707
|
.attr("x1", isLegendRightOrInset ? x1ForLegendTile : pos)
|
|
@@ -5671,10 +5711,10 @@ var legend$1 = {
|
|
|
5671
5711
|
.attr("stroke-width", config.legend_item_tile_height);
|
|
5672
5712
|
}
|
|
5673
5713
|
// Set background for inset legend
|
|
5674
|
-
background = legend.select(".".concat(
|
|
5714
|
+
background = legend.select(".".concat($LEGEND.legendBackground, " rect"));
|
|
5675
5715
|
if (state.isLegendInset && maxWidth > 0 && background.size() === 0) {
|
|
5676
|
-
background = legend.insert("g", ".".concat(
|
|
5677
|
-
.attr("class",
|
|
5716
|
+
background = legend.insert("g", ".".concat($LEGEND.legendItem))
|
|
5717
|
+
.attr("class", $LEGEND.legendBackground)
|
|
5678
5718
|
.append("rect");
|
|
5679
5719
|
}
|
|
5680
5720
|
var texts = legend.selectAll("text")
|
|
@@ -5686,7 +5726,7 @@ var legend$1 = {
|
|
|
5686
5726
|
$T(texts, withTransition)
|
|
5687
5727
|
.attr("x", xForLegendText)
|
|
5688
5728
|
.attr("y", yForLegendText);
|
|
5689
|
-
var rects = legend.selectAll("rect.".concat(
|
|
5729
|
+
var rects = legend.selectAll("rect.".concat($LEGEND.legendItemEvent))
|
|
5690
5730
|
.data(targetIdz);
|
|
5691
5731
|
$T(rects, withTransition)
|
|
5692
5732
|
.attr("width", function (id) { return widths[id]; })
|
|
@@ -5694,7 +5734,7 @@ var legend$1 = {
|
|
|
5694
5734
|
.attr("x", xForLegendRect)
|
|
5695
5735
|
.attr("y", yForLegendRect);
|
|
5696
5736
|
if (usePoint) {
|
|
5697
|
-
var tiles = legend.selectAll(".".concat(
|
|
5737
|
+
var tiles = legend.selectAll(".".concat($LEGEND.legendItemPoint))
|
|
5698
5738
|
.data(targetIdz);
|
|
5699
5739
|
$T(tiles, withTransition)
|
|
5700
5740
|
.each(function () {
|
|
@@ -5730,7 +5770,7 @@ var legend$1 = {
|
|
|
5730
5770
|
});
|
|
5731
5771
|
}
|
|
5732
5772
|
else {
|
|
5733
|
-
var tiles = legend.selectAll("line.".concat(
|
|
5773
|
+
var tiles = legend.selectAll("line.".concat($LEGEND.legendItemTile))
|
|
5734
5774
|
.data(targetIdz);
|
|
5735
5775
|
$T(tiles, withTransition)
|
|
5736
5776
|
.style("stroke", getColor)
|
|
@@ -5790,7 +5830,7 @@ var redraw = {
|
|
|
5790
5830
|
// @TODO: Make 'init' state to be accessible everywhere not passing as argument.
|
|
5791
5831
|
$$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing);
|
|
5792
5832
|
// Data empty label positioning and text.
|
|
5793
|
-
config.data_empty_label_text && main.select("text.".concat(
|
|
5833
|
+
config.data_empty_label_text && main.select("text.".concat($TEXT.text, ".").concat($COMMON.empty))
|
|
5794
5834
|
.attr("x", state.width / 2)
|
|
5795
5835
|
.attr("y", state.height / 2)
|
|
5796
5836
|
.text(config.data_empty_label_text)
|
|
@@ -5806,7 +5846,7 @@ var redraw = {
|
|
|
5806
5846
|
}
|
|
5807
5847
|
});
|
|
5808
5848
|
// circles for select
|
|
5809
|
-
$el.text && main.selectAll(".".concat(
|
|
5849
|
+
$el.text && main.selectAll(".".concat($SELECT.selectedCircles))
|
|
5810
5850
|
.filter($$.isBarType.bind($$))
|
|
5811
5851
|
.selectAll("circle")
|
|
5812
5852
|
.remove();
|
|
@@ -6345,9 +6385,11 @@ var shape = {
|
|
|
6345
6385
|
*/
|
|
6346
6386
|
getShapeYMin: function (id) {
|
|
6347
6387
|
var $$ = this;
|
|
6348
|
-
var
|
|
6388
|
+
var axisId = $$.axis.getId(id);
|
|
6389
|
+
var scale = $$.scale[axisId];
|
|
6349
6390
|
var yMin = scale.domain()[0];
|
|
6350
|
-
|
|
6391
|
+
var inverted = $$.config["axis_".concat(axisId, "_inverted")];
|
|
6392
|
+
return !$$.isGrouped(id) && !inverted && yMin > 0 ? yMin : 0;
|
|
6351
6393
|
},
|
|
6352
6394
|
/**
|
|
6353
6395
|
* Get Shape's offset data
|
|
@@ -6686,7 +6728,7 @@ var size = {
|
|
|
6686
6728
|
var $$ = this;
|
|
6687
6729
|
var config = $$.config, $el = $$.$el;
|
|
6688
6730
|
var hasLeftAxisRect = config.axis_rotated || (!config.axis_rotated && !config.axis_y_inner);
|
|
6689
|
-
var leftAxisClass = config.axis_rotated ?
|
|
6731
|
+
var leftAxisClass = config.axis_rotated ? $AXIS.axisX : $AXIS.axisY;
|
|
6690
6732
|
var leftAxis = $el.main.select(".".concat(leftAxisClass)).node();
|
|
6691
6733
|
var svgRect = leftAxis && hasLeftAxisRect ? leftAxis.getBoundingClientRect() : { right: 0 };
|
|
6692
6734
|
var chartRect = $el.chart.node().getBoundingClientRect();
|
|
@@ -6714,7 +6756,7 @@ var size = {
|
|
|
6714
6756
|
.attr("width", current.width)
|
|
6715
6757
|
.attr("height", current.height);
|
|
6716
6758
|
if (hasAxis) {
|
|
6717
|
-
var brush = svg.select(".".concat(
|
|
6759
|
+
var brush = svg.select(".".concat($SUBCHART.brush, " .overlay"));
|
|
6718
6760
|
var brushSize = { width: 0, height: 0 };
|
|
6719
6761
|
if (brush.size()) {
|
|
6720
6762
|
brushSize.width = +brush.attr("width");
|
|
@@ -6867,8 +6909,8 @@ var text = {
|
|
|
6867
6909
|
*/
|
|
6868
6910
|
initText: function () {
|
|
6869
6911
|
var $el = this.$el;
|
|
6870
|
-
$el.main.select(".".concat(
|
|
6871
|
-
.attr("class",
|
|
6912
|
+
$el.main.select(".".concat($COMMON.chart)).append("g")
|
|
6913
|
+
.attr("class", $TEXT.chartTexts);
|
|
6872
6914
|
},
|
|
6873
6915
|
/**
|
|
6874
6916
|
* Update chartText
|
|
@@ -6880,7 +6922,7 @@ var text = {
|
|
|
6880
6922
|
var classChartText = $$.getChartClass("Text");
|
|
6881
6923
|
var classTexts = $$.getClass("texts", "id");
|
|
6882
6924
|
var classFocus = $$.classFocus.bind($$);
|
|
6883
|
-
var mainTextUpdate = $$.$el.main.select(".".concat(
|
|
6925
|
+
var mainTextUpdate = $$.$el.main.select(".".concat($TEXT.chartTexts)).selectAll(".".concat($TEXT.chartText))
|
|
6884
6926
|
.data(targets)
|
|
6885
6927
|
.attr("class", function (d) { return classChartText(d) + classFocus(d); });
|
|
6886
6928
|
var mainTextEnter = mainTextUpdate.enter().append("g")
|
|
@@ -6898,8 +6940,8 @@ var text = {
|
|
|
6898
6940
|
var $$ = this;
|
|
6899
6941
|
var $el = $$.$el, $T = $$.$T, config = $$.config;
|
|
6900
6942
|
var classText = $$.getClass("text", "index");
|
|
6901
|
-
var text = $el.main.selectAll(".".concat(
|
|
6902
|
-
.selectAll(".".concat(
|
|
6943
|
+
var text = $el.main.selectAll(".".concat($TEXT.texts))
|
|
6944
|
+
.selectAll(".".concat($TEXT.text))
|
|
6903
6945
|
.data($$.labelishData.bind($$));
|
|
6904
6946
|
$T(text.exit())
|
|
6905
6947
|
.style("fill-opacity", "0")
|
|
@@ -7253,7 +7295,7 @@ var text = {
|
|
|
7253
7295
|
Math.ceil(nodeForWidth.node().getComputedTextLength());
|
|
7254
7296
|
var overlapsY = Math.ceil(Math.abs(translate.f - coordinate.f)) <
|
|
7255
7297
|
parseInt(textNode.style("font-size"), 10);
|
|
7256
|
-
filteredTextNode.classed(
|
|
7298
|
+
filteredTextNode.classed($TEXT.TextOverlapping, overlapsX && overlapsY);
|
|
7257
7299
|
});
|
|
7258
7300
|
},
|
|
7259
7301
|
/**
|
|
@@ -7267,7 +7309,7 @@ var text = {
|
|
|
7267
7309
|
$$.$el.arcs.selectAll(selector)
|
|
7268
7310
|
.each(function () {
|
|
7269
7311
|
selectAll([this, this.previousSibling])
|
|
7270
|
-
.classed(
|
|
7312
|
+
.classed($TEXT.TextOverlapping, false);
|
|
7271
7313
|
});
|
|
7272
7314
|
},
|
|
7273
7315
|
/**
|
|
@@ -7325,7 +7367,7 @@ var title = {
|
|
|
7325
7367
|
var text = $el.title
|
|
7326
7368
|
.append("text")
|
|
7327
7369
|
.style("text-anchor", getTextPos(config.title_position))
|
|
7328
|
-
.attr("class",
|
|
7370
|
+
.attr("class", $TEXT.title);
|
|
7329
7371
|
setTextValue(text, config.title_text, [0.3, 1.5]);
|
|
7330
7372
|
}
|
|
7331
7373
|
},
|
|
@@ -7355,7 +7397,7 @@ var title = {
|
|
|
7355
7397
|
var $$ = this;
|
|
7356
7398
|
var config = $$.config, current = $$.state.current;
|
|
7357
7399
|
var position = config.title_position || "left";
|
|
7358
|
-
var textRectWidth = $$.getTextRect($$.$el.title,
|
|
7400
|
+
var textRectWidth = $$.getTextRect($$.$el.title, $TEXT.title).width;
|
|
7359
7401
|
var x;
|
|
7360
7402
|
if (/(right|center)/.test(position)) {
|
|
7361
7403
|
x = current.width - textRectWidth;
|
|
@@ -7379,7 +7421,7 @@ var title = {
|
|
|
7379
7421
|
yForTitle: function () {
|
|
7380
7422
|
var $$ = this;
|
|
7381
7423
|
return ($$.config.title_padding.top || 0) +
|
|
7382
|
-
$$.getTextRect($$.$el.title,
|
|
7424
|
+
$$.getTextRect($$.$el.title, $TEXT.title).height;
|
|
7383
7425
|
},
|
|
7384
7426
|
/**
|
|
7385
7427
|
* Get title padding
|
|
@@ -7404,7 +7446,7 @@ var tooltip$1 = {
|
|
|
7404
7446
|
if ($el.tooltip.empty()) {
|
|
7405
7447
|
$el.tooltip = $el.chart
|
|
7406
7448
|
.append("div")
|
|
7407
|
-
.attr("class",
|
|
7449
|
+
.attr("class", $TOOLTIP.tooltipContainer)
|
|
7408
7450
|
.style("position", "absolute")
|
|
7409
7451
|
.style("pointer-events", "none")
|
|
7410
7452
|
.style("display", "none");
|
|
@@ -7527,12 +7569,12 @@ var tooltip$1 = {
|
|
|
7527
7569
|
var title = (state.hasAxis || state.hasRadar) &&
|
|
7528
7570
|
sanitise(titleFormat ? titleFormat(row.x) : row.x);
|
|
7529
7571
|
text = tplProcess(tpl[0], {
|
|
7530
|
-
CLASS_TOOLTIP:
|
|
7572
|
+
CLASS_TOOLTIP: $TOOLTIP.tooltip,
|
|
7531
7573
|
TITLE: isValue(title) ? (tplStr ? title : "<tr><th colspan=\"2\">".concat(title, "</th></tr>")) : ""
|
|
7532
7574
|
});
|
|
7533
7575
|
}
|
|
7534
7576
|
if (!row.ratio && $$.$el.arcs) {
|
|
7535
|
-
row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path.".concat(
|
|
7577
|
+
row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path.".concat($ARC.arc, "-").concat(row.id)).data()[0]);
|
|
7536
7578
|
}
|
|
7537
7579
|
param = [row.ratio, row.id, row.index, d];
|
|
7538
7580
|
value = sanitise(valueFormat.apply(void 0, __spreadArray([getRowValue(row)], param, false)));
|
|
@@ -7556,7 +7598,7 @@ var tooltip$1 = {
|
|
|
7556
7598
|
var name_1 = sanitise(nameFormat.apply(void 0, __spreadArray([row.name], param, false)));
|
|
7557
7599
|
var color_1 = getBgColor(row);
|
|
7558
7600
|
var contentValue_1 = {
|
|
7559
|
-
CLASS_TOOLTIP_NAME:
|
|
7601
|
+
CLASS_TOOLTIP_NAME: $TOOLTIP.tooltipName + $$.getTargetSelectorSuffix(row.id),
|
|
7560
7602
|
COLOR: (tplStr || !$$.patterns) ? color_1 : "<svg><rect style=\"fill:".concat(color_1, "\" width=\"10\" height=\"10\"></rect></svg>"),
|
|
7561
7603
|
NAME: name_1,
|
|
7562
7604
|
VALUE: value
|
|
@@ -7833,19 +7875,19 @@ var transform = {
|
|
|
7833
7875
|
var main = $$.$el.main, $T = $$.$T;
|
|
7834
7876
|
var xAxis = (transitions === null || transitions === void 0 ? void 0 : transitions.axisX) ?
|
|
7835
7877
|
transitions.axisX :
|
|
7836
|
-
$T(main.select(".".concat(
|
|
7878
|
+
$T(main.select(".".concat($AXIS.axisX)), withTransition);
|
|
7837
7879
|
var yAxis = (transitions === null || transitions === void 0 ? void 0 : transitions.axisY) ?
|
|
7838
7880
|
transitions.axisY :
|
|
7839
|
-
$T(main.select(".".concat(
|
|
7881
|
+
$T(main.select(".".concat($AXIS.axisY)), withTransition);
|
|
7840
7882
|
var y2Axis = (transitions === null || transitions === void 0 ? void 0 : transitions.axisY2) ?
|
|
7841
7883
|
transitions.axisY2 :
|
|
7842
|
-
$T(main.select(".".concat(
|
|
7884
|
+
$T(main.select(".".concat($AXIS.axisY2)), withTransition);
|
|
7843
7885
|
$T(main, withTransition)
|
|
7844
7886
|
.attr("transform", $$.getTranslate("main"));
|
|
7845
7887
|
xAxis.attr("transform", $$.getTranslate("x"));
|
|
7846
7888
|
yAxis.attr("transform", $$.getTranslate("y"));
|
|
7847
7889
|
y2Axis.attr("transform", $$.getTranslate("y2"));
|
|
7848
|
-
main.select(".".concat(
|
|
7890
|
+
main.select(".".concat($ARC.chartArcs))
|
|
7849
7891
|
.attr("transform", $$.getTranslate("arc"));
|
|
7850
7892
|
},
|
|
7851
7893
|
transformAll: function (withTransition, transitions) {
|
|
@@ -8364,7 +8406,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8364
8406
|
$$.bindResize();
|
|
8365
8407
|
// Define regions
|
|
8366
8408
|
var main = $el.svg.append("g")
|
|
8367
|
-
.classed(
|
|
8409
|
+
.classed($COMMON.main, true)
|
|
8368
8410
|
.attr("transform", $$.getTranslate("main"));
|
|
8369
8411
|
$el.main = main;
|
|
8370
8412
|
// initialize subchart when subchart show option is set
|
|
@@ -8376,7 +8418,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8376
8418
|
// text when empty
|
|
8377
8419
|
if (config.data_empty_label_text) {
|
|
8378
8420
|
main.append("text")
|
|
8379
|
-
.attr("class", "".concat(
|
|
8421
|
+
.attr("class", "".concat($TEXT.text, " ").concat($COMMON.empty))
|
|
8380
8422
|
.attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers.
|
|
8381
8423
|
.attr("dominant-baseline", "middle"); // vertical centering of text at y position in all browsers, except IE.
|
|
8382
8424
|
}
|
|
@@ -8387,7 +8429,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8387
8429
|
!config.clipPath && $$.axis.init();
|
|
8388
8430
|
}
|
|
8389
8431
|
// Define g for chart area
|
|
8390
|
-
main.append("g").attr("class",
|
|
8432
|
+
main.append("g").attr("class", $COMMON.chart)
|
|
8391
8433
|
.attr("clip-path", state.clip.path);
|
|
8392
8434
|
$$.callPluginHook("$init");
|
|
8393
8435
|
if (hasAxis) {
|
|
@@ -8546,7 +8588,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
8546
8588
|
ChartInternal.prototype.showTargets = function () {
|
|
8547
8589
|
var $$ = this;
|
|
8548
8590
|
var svg = $$.$el.svg, $T = $$.$T;
|
|
8549
|
-
$T(svg.selectAll(".".concat(
|
|
8591
|
+
$T(svg.selectAll(".".concat($COMMON.target))
|
|
8550
8592
|
.filter(function (d) { return $$.isTargetToShow(d.id); })).style("opacity", null);
|
|
8551
8593
|
};
|
|
8552
8594
|
ChartInternal.prototype.getWithOption = function (options) {
|
|
@@ -9176,11 +9218,11 @@ var apiFocus = {
|
|
|
9176
9218
|
var candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
|
|
9177
9219
|
this.revert();
|
|
9178
9220
|
this.defocus();
|
|
9179
|
-
candidates.classed(
|
|
9221
|
+
candidates.classed($FOCUS.focused, true).classed($FOCUS.defocused, false);
|
|
9180
9222
|
if ($$.hasArcType() && !state.hasRadar) {
|
|
9181
9223
|
$$.expandArc(targetIds);
|
|
9182
9224
|
$$.hasType("gauge") &&
|
|
9183
|
-
$$.markOverlapped(targetIdsValue, $$, ".".concat(
|
|
9225
|
+
$$.markOverlapped(targetIdsValue, $$, ".".concat($GAUGE.gaugeValue));
|
|
9184
9226
|
}
|
|
9185
9227
|
$$.toggleFocusLegend(targetIds, true);
|
|
9186
9228
|
state.focusedTargetIds = targetIds;
|
|
@@ -9208,11 +9250,11 @@ var apiFocus = {
|
|
|
9208
9250
|
var state = $$.state;
|
|
9209
9251
|
var targetIds = $$.mapToTargetIds(targetIdsValue);
|
|
9210
9252
|
var candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
|
|
9211
|
-
candidates.classed(
|
|
9253
|
+
candidates.classed($FOCUS.focused, false).classed($FOCUS.defocused, true);
|
|
9212
9254
|
if ($$.hasArcType()) {
|
|
9213
9255
|
$$.unexpandArc(targetIds);
|
|
9214
9256
|
$$.hasType("gauge") &&
|
|
9215
|
-
$$.undoMarkOverlapped($$, ".".concat(
|
|
9257
|
+
$$.undoMarkOverlapped($$, ".".concat($GAUGE.gaugeValue));
|
|
9216
9258
|
}
|
|
9217
9259
|
$$.toggleFocusLegend(targetIds, false);
|
|
9218
9260
|
state.focusedTargetIds = state.focusedTargetIds.filter(function (id) { return targetIds.indexOf(id) < 0; });
|
|
@@ -9240,15 +9282,15 @@ var apiFocus = {
|
|
|
9240
9282
|
var config = $$.config, state = $$.state, $el = $$.$el;
|
|
9241
9283
|
var targetIds = $$.mapToTargetIds(targetIdsValue);
|
|
9242
9284
|
var candidates = $el.svg.selectAll($$.selectorTargets(targetIds)); // should be for all targets
|
|
9243
|
-
candidates.classed(
|
|
9285
|
+
candidates.classed($FOCUS.focused, false).classed($FOCUS.defocused, false);
|
|
9244
9286
|
$$.hasArcType() && $$.unexpandArc(targetIds);
|
|
9245
9287
|
if (config.legend_show) {
|
|
9246
9288
|
$$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
|
|
9247
9289
|
$el.legend.selectAll($$.selectorLegends(targetIds))
|
|
9248
9290
|
.filter(function () {
|
|
9249
|
-
return select(this).classed(
|
|
9291
|
+
return select(this).classed($FOCUS.legendItemFocused);
|
|
9250
9292
|
})
|
|
9251
|
-
.classed(
|
|
9293
|
+
.classed($FOCUS.legendItemFocused, false);
|
|
9252
9294
|
}
|
|
9253
9295
|
state.focusedTargetIds = [];
|
|
9254
9296
|
state.defocusedTargetIds = [];
|
|
@@ -10386,8 +10428,8 @@ extend(regions, {
|
|
|
10386
10428
|
var $$ = this.internal;
|
|
10387
10429
|
var config = $$.config, $T = $$.$T;
|
|
10388
10430
|
var options = optionsValue || {};
|
|
10389
|
-
var classes = getOption(options, "classes", [
|
|
10390
|
-
var regions = $$.$el.main.select(".".concat(
|
|
10431
|
+
var classes = getOption(options, "classes", [$REGION.region]);
|
|
10432
|
+
var regions = $$.$el.main.select(".".concat($REGION.regions))
|
|
10391
10433
|
.selectAll(classes.map(function (c) { return ".".concat(c); }));
|
|
10392
10434
|
$T(regions)
|
|
10393
10435
|
.style("opacity", "0")
|
|
@@ -11261,7 +11303,7 @@ var Axis = /** @class */ (function () {
|
|
|
11261
11303
|
this.setOrient();
|
|
11262
11304
|
}
|
|
11263
11305
|
Axis.prototype.getAxisClassName = function (id) {
|
|
11264
|
-
return "".concat(
|
|
11306
|
+
return "".concat($AXIS.axis, " ").concat($AXIS["axis".concat(capitalize(id))]);
|
|
11265
11307
|
};
|
|
11266
11308
|
Axis.prototype.isHorizontal = function ($$, forHorizontal) {
|
|
11267
11309
|
var isRotated = $$.config.axis_rotated;
|
|
@@ -11306,7 +11348,7 @@ var Axis = /** @class */ (function () {
|
|
|
11306
11348
|
config.axis_y2_show && target.push("y2");
|
|
11307
11349
|
target.forEach(function (v) {
|
|
11308
11350
|
var classAxis = _this.getAxisClassName(v);
|
|
11309
|
-
var classLabel =
|
|
11351
|
+
var classLabel = $AXIS["axis".concat(v.toUpperCase(), "Label")];
|
|
11310
11352
|
axis[v] = main.append("g")
|
|
11311
11353
|
.attr("class", classAxis)
|
|
11312
11354
|
.attr("clip-path", function () {
|
|
@@ -11385,7 +11427,7 @@ var Axis = /** @class */ (function () {
|
|
|
11385
11427
|
Axis.prototype.updateAxes = function () {
|
|
11386
11428
|
var _this = this;
|
|
11387
11429
|
var $$ = this.owner;
|
|
11388
|
-
var config = $$.config, main = $$.$el.main;
|
|
11430
|
+
var config = $$.config, main = $$.$el.main, $T = $$.$T;
|
|
11389
11431
|
Object.keys(this.axesList).forEach(function (id) {
|
|
11390
11432
|
var axesConfig = config["axis_".concat(id, "_axes")];
|
|
11391
11433
|
var scale = $$.scale[id].copy();
|
|
@@ -11407,7 +11449,7 @@ var Axis = /** @class */ (function () {
|
|
|
11407
11449
|
}
|
|
11408
11450
|
else {
|
|
11409
11451
|
axesConfig[i].domain && scale.domain(axesConfig[i].domain);
|
|
11410
|
-
|
|
11452
|
+
$T(g).call(v.scale(scale));
|
|
11411
11453
|
}
|
|
11412
11454
|
g.attr("transform", $$.getTranslate(id, i + 1));
|
|
11413
11455
|
});
|
|
@@ -11811,9 +11853,9 @@ var Axis = /** @class */ (function () {
|
|
|
11811
11853
|
var $$ = this.owner;
|
|
11812
11854
|
var main = $$.$el.main, $T = $$.$T;
|
|
11813
11855
|
var labels = {
|
|
11814
|
-
x: main.select(".".concat(
|
|
11815
|
-
y: main.select(".".concat(
|
|
11816
|
-
y2: main.select(".".concat(
|
|
11856
|
+
x: main.select(".".concat($AXIS.axisX, " .").concat($AXIS.axisXLabel)),
|
|
11857
|
+
y: main.select(".".concat($AXIS.axisY, " .").concat($AXIS.axisYLabel)),
|
|
11858
|
+
y2: main.select(".".concat($AXIS.axisY2, " .").concat($AXIS.axisY2Label))
|
|
11817
11859
|
};
|
|
11818
11860
|
Object.keys(labels).filter(function (id) { return !labels[id].empty(); })
|
|
11819
11861
|
.forEach(function (v) {
|
|
@@ -11933,10 +11975,11 @@ var Axis = /** @class */ (function () {
|
|
|
11933
11975
|
xDomainForZoom = scale.x.orgDomain();
|
|
11934
11976
|
}
|
|
11935
11977
|
["y", "y2"].forEach(function (key) {
|
|
11978
|
+
var prefix = "axis_".concat(key, "_");
|
|
11936
11979
|
var axisScale = scale[key];
|
|
11937
|
-
if (axisScale) {
|
|
11938
|
-
var tickValues = config["
|
|
11939
|
-
var tickCount = config["
|
|
11980
|
+
if (config["".concat(prefix, "show")] && axisScale) {
|
|
11981
|
+
var tickValues = config["".concat(prefix, "tick_values")];
|
|
11982
|
+
var tickCount = config["".concat(prefix, "tick_count")];
|
|
11940
11983
|
axisScale.domain($$.getYDomain(targetsToShow, key, xDomainForZoom));
|
|
11941
11984
|
if (!tickValues && tickCount) {
|
|
11942
11985
|
var axis = $$.axis[key];
|
|
@@ -11999,7 +12042,7 @@ var Axis = /** @class */ (function () {
|
|
|
11999
12042
|
// set/unset x_axis_tick_clippath
|
|
12000
12043
|
if (type === "x") {
|
|
12001
12044
|
var clipPath = current.maxTickWidths.x.clipPath ? clip.pathXAxisTickTexts : null;
|
|
12002
|
-
$el.svg.selectAll(".".concat(
|
|
12045
|
+
$el.svg.selectAll(".".concat($AXIS.axisX, " .tick text"))
|
|
12003
12046
|
.attr("clip-path", clipPath);
|
|
12004
12047
|
}
|
|
12005
12048
|
}
|
|
@@ -12020,9 +12063,9 @@ var eventrect = {
|
|
|
12020
12063
|
*/
|
|
12021
12064
|
initEventRect: function () {
|
|
12022
12065
|
var $$ = this;
|
|
12023
|
-
$$.$el.main.select(".".concat(
|
|
12066
|
+
$$.$el.main.select(".".concat($COMMON.chart))
|
|
12024
12067
|
.append("g")
|
|
12025
|
-
.attr("class",
|
|
12068
|
+
.attr("class", $EVENT.eventRects)
|
|
12026
12069
|
.style("fill-opacity", "0");
|
|
12027
12070
|
},
|
|
12028
12071
|
/**
|
|
@@ -12038,12 +12081,12 @@ var eventrect = {
|
|
|
12038
12081
|
$$.updateEventRect($el.eventRect, true);
|
|
12039
12082
|
}
|
|
12040
12083
|
else {
|
|
12041
|
-
var eventRects = $$.$el.main.select(".".concat(
|
|
12084
|
+
var eventRects = $$.$el.main.select(".".concat($EVENT.eventRects))
|
|
12042
12085
|
.style("cursor", config.zoom_enabled && config.zoom_type !== "drag" ? (config.axis_rotated ? "ns-resize" : "ew-resize") : null)
|
|
12043
|
-
.classed(
|
|
12044
|
-
.classed(
|
|
12086
|
+
.classed($EVENT.eventRectsMultiple, isMultipleX)
|
|
12087
|
+
.classed($EVENT.eventRectsSingle, !isMultipleX);
|
|
12045
12088
|
// append event <rect>
|
|
12046
|
-
var eventRectUpdate = eventRects.selectAll(".".concat(
|
|
12089
|
+
var eventRectUpdate = eventRects.selectAll(".".concat($EVENT.eventRect))
|
|
12047
12090
|
.data([0])
|
|
12048
12091
|
.enter()
|
|
12049
12092
|
.append("rect");
|
|
@@ -12124,7 +12167,7 @@ var eventrect = {
|
|
|
12124
12167
|
})
|
|
12125
12168
|
.on("touchstart.eventRect touchmove.eventRect", function (event) {
|
|
12126
12169
|
state.event = event;
|
|
12127
|
-
if (!eventRect.empty() && eventRect.classed(
|
|
12170
|
+
if (!eventRect.empty() && eventRect.classed($EVENT.eventRect)) {
|
|
12128
12171
|
// if touch points are > 1, means doing zooming interaction. In this case do not execute tooltip codes.
|
|
12129
12172
|
if (state.dragging || state.flowing || $$.hasArcType() || event.touches.length > 1) {
|
|
12130
12173
|
return;
|
|
@@ -12138,7 +12181,7 @@ var eventrect = {
|
|
|
12138
12181
|
}, true)
|
|
12139
12182
|
.on("touchend.eventRect", function (event) {
|
|
12140
12183
|
state.event = event;
|
|
12141
|
-
if (!eventRect.empty() && eventRect.classed(
|
|
12184
|
+
if (!eventRect.empty() && eventRect.classed($EVENT.eventRect)) {
|
|
12142
12185
|
if ($$.hasArcType() || !$$.toggleShape || state.cancelClick) {
|
|
12143
12186
|
state.cancelClick && (state.cancelClick = false);
|
|
12144
12187
|
}
|
|
@@ -12175,7 +12218,7 @@ var eventrect = {
|
|
|
12175
12218
|
.attr("height", height);
|
|
12176
12219
|
// only for init
|
|
12177
12220
|
if (!rendered) {
|
|
12178
|
-
rectElement.attr("class",
|
|
12221
|
+
rectElement.attr("class", $EVENT.eventRect);
|
|
12179
12222
|
}
|
|
12180
12223
|
}
|
|
12181
12224
|
updateClientRect();
|
|
@@ -12287,7 +12330,7 @@ var eventrect = {
|
|
|
12287
12330
|
$$.showGridFocus(selectedData);
|
|
12288
12331
|
// Show cursor as pointer if point is close to mouse position
|
|
12289
12332
|
if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
|
|
12290
|
-
$$.$el.svg.select(".".concat(
|
|
12333
|
+
$$.$el.svg.select(".".concat($EVENT.eventRect)).style("cursor", "pointer");
|
|
12291
12334
|
if (!state.mouseover) {
|
|
12292
12335
|
config.data_onover.call($$.api, closest);
|
|
12293
12336
|
state.mouseover = closest;
|
|
@@ -12301,7 +12344,7 @@ var eventrect = {
|
|
|
12301
12344
|
unselectRect: function () {
|
|
12302
12345
|
var $$ = this;
|
|
12303
12346
|
var config = $$.config, _a = $$.$el, circle = _a.circle, tooltip = _a.tooltip;
|
|
12304
|
-
$$.$el.svg.select(".".concat(
|
|
12347
|
+
$$.$el.svg.select(".".concat($EVENT.eventRect)).style("cursor", null);
|
|
12305
12348
|
$$.hideGridFocus();
|
|
12306
12349
|
if (tooltip) {
|
|
12307
12350
|
$$.hideTooltip();
|
|
@@ -12313,8 +12356,8 @@ var eventrect = {
|
|
|
12313
12356
|
/**
|
|
12314
12357
|
* Create eventRect for each data on the x-axis.
|
|
12315
12358
|
* Register touch and drag events.
|
|
12316
|
-
* @param {object} eventRectEnter d3.select(
|
|
12317
|
-
* @returns {object} d3.select(
|
|
12359
|
+
* @param {object} eventRectEnter d3.select($EVENT.eventRects) object.
|
|
12360
|
+
* @returns {object} d3.select($EVENT.eventRects) object.
|
|
12318
12361
|
* @private
|
|
12319
12362
|
*/
|
|
12320
12363
|
generateEventRectsForSingleX: function (eventRectEnter) {
|
|
@@ -12397,7 +12440,7 @@ var eventrect = {
|
|
|
12397
12440
|
return;
|
|
12398
12441
|
}
|
|
12399
12442
|
var index = d.index;
|
|
12400
|
-
main.selectAll(".".concat(
|
|
12443
|
+
main.selectAll(".".concat($SHAPE.shape, "-").concat(index))
|
|
12401
12444
|
.each(function (d2) {
|
|
12402
12445
|
var _a;
|
|
12403
12446
|
if (config.data_selection_grouped || $$.isWithinShape(this, d2)) {
|
|
@@ -12409,7 +12452,7 @@ var eventrect = {
|
|
|
12409
12452
|
/**
|
|
12410
12453
|
* Create an eventRect,
|
|
12411
12454
|
* Register touch and drag events.
|
|
12412
|
-
* @param {object} eventRectEnter d3.select(
|
|
12455
|
+
* @param {object} eventRectEnter d3.select($EVENT.eventRects) object.
|
|
12413
12456
|
* @private
|
|
12414
12457
|
*/
|
|
12415
12458
|
generateEventRectsForMultipleXs: function (eventRectEnter) {
|
|
@@ -12450,8 +12493,8 @@ var eventrect = {
|
|
|
12450
12493
|
}
|
|
12451
12494
|
// select if selection enabled
|
|
12452
12495
|
if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
|
|
12453
|
-
$$.$el.main.selectAll(".".concat(
|
|
12454
|
-
.selectAll(".".concat(
|
|
12496
|
+
$$.$el.main.selectAll(".".concat($SHAPE.shapes).concat($$.getTargetSelectorSuffix(closest.id)))
|
|
12497
|
+
.selectAll(".".concat($SHAPE.shape, "-").concat(closest.index))
|
|
12455
12498
|
.each(function () {
|
|
12456
12499
|
var _a;
|
|
12457
12500
|
if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {
|
|
@@ -12846,11 +12889,11 @@ var grid = {
|
|
|
12846
12889
|
var $$ = this;
|
|
12847
12890
|
var config = $$.config, clip = $$.state.clip, $el = $$.$el;
|
|
12848
12891
|
if (config.grid_x_lines.length || config.grid_y_lines.length) {
|
|
12849
|
-
$el.gridLines.main = $el.main.insert("g", ".".concat(
|
|
12892
|
+
$el.gridLines.main = $el.main.insert("g", ".".concat($COMMON.chart).concat(config.grid_lines_front ? " + *" : ""))
|
|
12850
12893
|
.attr("clip-path", clip.pathGrid)
|
|
12851
|
-
.attr("class", "".concat(
|
|
12852
|
-
$el.gridLines.main.append("g").attr("class",
|
|
12853
|
-
$el.gridLines.main.append("g").attr("class",
|
|
12894
|
+
.attr("class", "".concat($GRID.grid, " ").concat($GRID.gridLines));
|
|
12895
|
+
$el.gridLines.main.append("g").attr("class", $GRID.xgridLines);
|
|
12896
|
+
$el.gridLines.main.append("g").attr("class", $GRID.ygridLines);
|
|
12854
12897
|
$el.gridLines.x = selectAll([]);
|
|
12855
12898
|
}
|
|
12856
12899
|
},
|
|
@@ -12872,13 +12915,13 @@ var grid = {
|
|
|
12872
12915
|
"y1": 0,
|
|
12873
12916
|
"y2": state.height
|
|
12874
12917
|
};
|
|
12875
|
-
grid.x = main.select(".".concat(
|
|
12876
|
-
.selectAll(".".concat(
|
|
12918
|
+
grid.x = main.select(".".concat($GRID.xgrids))
|
|
12919
|
+
.selectAll(".".concat($GRID.xgrid))
|
|
12877
12920
|
.data(xgridData);
|
|
12878
12921
|
grid.x.exit().remove();
|
|
12879
12922
|
grid.x = grid.x.enter()
|
|
12880
12923
|
.append("line")
|
|
12881
|
-
.attr("class",
|
|
12924
|
+
.attr("class", $GRID.xgrid)
|
|
12882
12925
|
.merge(grid.x);
|
|
12883
12926
|
if (!withoutUpdate) {
|
|
12884
12927
|
grid.x.each(function () {
|
|
@@ -12897,14 +12940,14 @@ var grid = {
|
|
|
12897
12940
|
var isRotated = config.axis_rotated;
|
|
12898
12941
|
var gridValues = $$.axis.y.tickValues() || $$.scale.y.ticks(config.grid_y_ticks);
|
|
12899
12942
|
var pos = function (d) { return Math.ceil($$.scale.y(d)); };
|
|
12900
|
-
grid.y = main.select(".".concat(
|
|
12901
|
-
.selectAll(".".concat(
|
|
12943
|
+
grid.y = main.select(".".concat($GRID.ygrids))
|
|
12944
|
+
.selectAll(".".concat($GRID.ygrid))
|
|
12902
12945
|
.data(gridValues);
|
|
12903
12946
|
grid.y.exit().remove();
|
|
12904
12947
|
grid.y = grid.y
|
|
12905
12948
|
.enter()
|
|
12906
12949
|
.append("line")
|
|
12907
|
-
.attr("class",
|
|
12950
|
+
.attr("class", $GRID.ygrid)
|
|
12908
12951
|
.merge(grid.y);
|
|
12909
12952
|
grid.y.attr("x1", isRotated ? pos : 0)
|
|
12910
12953
|
.attr("x2", isRotated ? pos : state.width)
|
|
@@ -12931,8 +12974,8 @@ var grid = {
|
|
|
12931
12974
|
var config = $$.config, _a = $$.$el, gridLines = _a.gridLines, main = _a.main, $T = $$.$T;
|
|
12932
12975
|
var isRotated = config.axis_rotated;
|
|
12933
12976
|
config.grid_x_show && $$.updateXGrid();
|
|
12934
|
-
var xLines = main.select(".".concat(
|
|
12935
|
-
.selectAll(".".concat(
|
|
12977
|
+
var xLines = main.select(".".concat($GRID.xgridLines))
|
|
12978
|
+
.selectAll(".".concat($GRID.xgridLine))
|
|
12936
12979
|
.data(config.grid_x_lines);
|
|
12937
12980
|
// exit
|
|
12938
12981
|
$T(xLines.exit())
|
|
@@ -12948,7 +12991,7 @@ var grid = {
|
|
|
12948
12991
|
.style("opacity", "0");
|
|
12949
12992
|
xLines = xgridLine.merge(xLines);
|
|
12950
12993
|
$T(xLines
|
|
12951
|
-
.attr("class", function (d) { return "".concat(
|
|
12994
|
+
.attr("class", function (d) { return "".concat($GRID.xgridLine, " ").concat(d["class"] || "").trim(); })
|
|
12952
12995
|
.select("text")
|
|
12953
12996
|
.attr("text-anchor", getGridTextAnchor)
|
|
12954
12997
|
.attr("dx", getGridTextDx))
|
|
@@ -12965,8 +13008,8 @@ var grid = {
|
|
|
12965
13008
|
var config = $$.config, _a = $$.state, width = _a.width, height = _a.height, $el = $$.$el, $T = $$.$T;
|
|
12966
13009
|
var isRotated = config.axis_rotated;
|
|
12967
13010
|
config.grid_y_show && $$.updateYGrid();
|
|
12968
|
-
var ygridLines = $el.main.select(".".concat(
|
|
12969
|
-
.selectAll(".".concat(
|
|
13011
|
+
var ygridLines = $el.main.select(".".concat($GRID.ygridLines))
|
|
13012
|
+
.selectAll(".".concat($GRID.ygridLine))
|
|
12970
13013
|
.data(config.grid_y_lines);
|
|
12971
13014
|
// exit
|
|
12972
13015
|
$T(ygridLines.exit())
|
|
@@ -12983,7 +13026,7 @@ var grid = {
|
|
|
12983
13026
|
// update
|
|
12984
13027
|
var yv = $$.yv.bind($$);
|
|
12985
13028
|
$T(ygridLines
|
|
12986
|
-
.attr("class", function (d) { return "".concat(
|
|
13029
|
+
.attr("class", function (d) { return "".concat($GRID.ygridLine, " ").concat(d["class"] || "").trim(); })
|
|
12987
13030
|
.select("line"))
|
|
12988
13031
|
.attr("x1", isRotated ? yv : 0)
|
|
12989
13032
|
.attr("x2", isRotated ? yv : width)
|
|
@@ -13024,26 +13067,26 @@ var grid = {
|
|
|
13024
13067
|
var $$ = this;
|
|
13025
13068
|
var config = $$.config, clip = $$.state.clip, $el = $$.$el;
|
|
13026
13069
|
var isFront = config.grid_front;
|
|
13027
|
-
var className = ".".concat(
|
|
13070
|
+
var className = ".".concat(isFront && $el.gridLines.main ? $GRID.gridLines : $COMMON.chart).concat(isFront ? " + *" : "");
|
|
13028
13071
|
var grid = $el.main.insert("g", className)
|
|
13029
13072
|
.attr("clip-path", clip.pathGrid)
|
|
13030
|
-
.attr("class",
|
|
13073
|
+
.attr("class", $GRID.grid);
|
|
13031
13074
|
$el.grid.main = grid;
|
|
13032
13075
|
config.grid_x_show &&
|
|
13033
|
-
grid.append("g").attr("class",
|
|
13076
|
+
grid.append("g").attr("class", $GRID.xgrids);
|
|
13034
13077
|
config.grid_y_show &&
|
|
13035
|
-
grid.append("g").attr("class",
|
|
13078
|
+
grid.append("g").attr("class", $GRID.ygrids);
|
|
13036
13079
|
if (config.interaction_enabled && config.grid_focus_show) {
|
|
13037
13080
|
grid.append("g")
|
|
13038
|
-
.attr("class",
|
|
13081
|
+
.attr("class", $FOCUS.xgridFocus)
|
|
13039
13082
|
.append("line")
|
|
13040
|
-
.attr("class",
|
|
13083
|
+
.attr("class", $FOCUS.xgridFocus);
|
|
13041
13084
|
// to show xy focus grid line, should be 'tooltip.grouped=false'
|
|
13042
13085
|
if (config.grid_focus_y && !config.tooltip_grouped) {
|
|
13043
13086
|
grid.append("g")
|
|
13044
|
-
.attr("class",
|
|
13087
|
+
.attr("class", $FOCUS.ygridFocus)
|
|
13045
13088
|
.append("line")
|
|
13046
|
-
.attr("class",
|
|
13089
|
+
.attr("class", $FOCUS.ygridFocus);
|
|
13047
13090
|
}
|
|
13048
13091
|
}
|
|
13049
13092
|
},
|
|
@@ -13057,7 +13100,7 @@ var grid = {
|
|
|
13057
13100
|
var $$ = this;
|
|
13058
13101
|
var config = $$.config, _b = $$.state, width = _b.width, height = _b.height;
|
|
13059
13102
|
var isRotated = config.axis_rotated;
|
|
13060
|
-
var focusEl = $$.$el.main.selectAll("line.".concat(
|
|
13103
|
+
var focusEl = $$.$el.main.selectAll("line.".concat($FOCUS.xgridFocus, ", line.").concat($FOCUS.ygridFocus));
|
|
13061
13104
|
var dataToShow = (data || [focusEl.datum()]).filter(function (d) { return d && isValue($$.getBaseValue(d)); });
|
|
13062
13105
|
// Hide when bubble/scatter/stanford plot exists
|
|
13063
13106
|
if (!config.tooltip_show || dataToShow.length === 0 || $$.hasType("bubble") || $$.hasArcType()) {
|
|
@@ -13075,7 +13118,7 @@ var grid = {
|
|
|
13075
13118
|
y: $$.getYScaleById(d.id)(d.value)
|
|
13076
13119
|
};
|
|
13077
13120
|
var xy;
|
|
13078
|
-
if (el.classed(
|
|
13121
|
+
if (el.classed($FOCUS.xgridFocus)) {
|
|
13079
13122
|
// will contain 'x1, y1, x2, y2' order
|
|
13080
13123
|
xy = isRotated ?
|
|
13081
13124
|
[
|
|
@@ -13116,7 +13159,7 @@ var grid = {
|
|
|
13116
13159
|
var $$ = this;
|
|
13117
13160
|
var _b = $$.state, inputType = _b.inputType, resizing = _b.resizing, main = $$.$el.main;
|
|
13118
13161
|
if (inputType === "mouse" || !resizing) {
|
|
13119
|
-
main.selectAll("line.".concat(
|
|
13162
|
+
main.selectAll("line.".concat($FOCUS.xgridFocus, ", line.").concat($FOCUS.ygridFocus))
|
|
13120
13163
|
.style("visibility", "hidden");
|
|
13121
13164
|
(_a = $$.hideCircleFocus) === null || _a === void 0 ? void 0 : _a.call($$);
|
|
13122
13165
|
}
|
|
@@ -13125,7 +13168,7 @@ var grid = {
|
|
|
13125
13168
|
var _a;
|
|
13126
13169
|
var $$ = this;
|
|
13127
13170
|
var _b = $$.state, inputType = _b.inputType, width = _b.width, height = _b.height, resizing = _b.resizing, grid = $$.$el.grid;
|
|
13128
|
-
var xgridFocus = grid.main.select("line.".concat(
|
|
13171
|
+
var xgridFocus = grid.main.select("line.".concat($FOCUS.xgridFocus));
|
|
13129
13172
|
if (inputType === "touch") {
|
|
13130
13173
|
if (xgridFocus.empty()) {
|
|
13131
13174
|
resizing && ((_a = $$.showCircleFocus) === null || _a === void 0 ? void 0 : _a.call($$));
|
|
@@ -13148,7 +13191,7 @@ var grid = {
|
|
|
13148
13191
|
},
|
|
13149
13192
|
generateGridData: function (type, scale) {
|
|
13150
13193
|
var $$ = this;
|
|
13151
|
-
var tickNum = $$.$el.main.select(".".concat(
|
|
13194
|
+
var tickNum = $$.$el.main.select(".".concat($AXIS.axisX))
|
|
13152
13195
|
.selectAll(".tick")
|
|
13153
13196
|
.size();
|
|
13154
13197
|
var gridData = [];
|
|
@@ -13183,8 +13226,8 @@ var grid = {
|
|
|
13183
13226
|
var config = $$.config, $T = $$.$T;
|
|
13184
13227
|
var toRemove = $$.getGridFilterToRemove(params);
|
|
13185
13228
|
var toShow = function (line) { return !toRemove(line); };
|
|
13186
|
-
var classLines = forX ?
|
|
13187
|
-
var classLine = forX ?
|
|
13229
|
+
var classLines = forX ? $GRID.xgridLines : $GRID.ygridLines;
|
|
13230
|
+
var classLine = forX ? $GRID.xgridLine : $GRID.ygridLine;
|
|
13188
13231
|
$T($$.$el.main.select(".".concat(classLines))
|
|
13189
13232
|
.selectAll(".".concat(classLine))
|
|
13190
13233
|
.filter(toRemove))
|
|
@@ -13206,7 +13249,7 @@ var region = {
|
|
|
13206
13249
|
$el.region.main = $el.main
|
|
13207
13250
|
.insert("g", ":first-child")
|
|
13208
13251
|
.attr("clip-path", $$.state.clip.path)
|
|
13209
|
-
.attr("class",
|
|
13252
|
+
.attr("class", $REGION.regions);
|
|
13210
13253
|
},
|
|
13211
13254
|
updateRegion: function () {
|
|
13212
13255
|
var $$ = this;
|
|
@@ -13218,7 +13261,7 @@ var region = {
|
|
|
13218
13261
|
region.main.style("visibility", $$.hasArcType() ? "hidden" : null);
|
|
13219
13262
|
// select <g> element
|
|
13220
13263
|
var list = region.main
|
|
13221
|
-
.selectAll(".".concat(
|
|
13264
|
+
.selectAll(".".concat($REGION.region))
|
|
13222
13265
|
.data(config.regions);
|
|
13223
13266
|
$T(list.exit())
|
|
13224
13267
|
.style("opacity", "0")
|
|
@@ -15568,14 +15611,14 @@ var shapeArc = {
|
|
|
15568
15611
|
var interval_1 = setInterval(function () {
|
|
15569
15612
|
if (!transiting) {
|
|
15570
15613
|
clearInterval(interval_1);
|
|
15571
|
-
$el.legend.selectAll(".".concat(
|
|
15614
|
+
$el.legend.selectAll(".".concat($FOCUS.legendItemFocused)).size() > 0 &&
|
|
15572
15615
|
$$.expandArc(targetIds);
|
|
15573
15616
|
}
|
|
15574
15617
|
}, 10);
|
|
15575
15618
|
return;
|
|
15576
15619
|
}
|
|
15577
15620
|
var newTargetIds = $$.mapToTargetIds(targetIds);
|
|
15578
|
-
$el.svg.selectAll($$.selectorTargets(newTargetIds, ".".concat(
|
|
15621
|
+
$el.svg.selectAll($$.selectorTargets(newTargetIds, ".".concat($ARC.chartArc)))
|
|
15579
15622
|
.each(function (d) {
|
|
15580
15623
|
if (!$$.shouldExpand(d.data.id)) {
|
|
15581
15624
|
return;
|
|
@@ -15598,12 +15641,12 @@ var shapeArc = {
|
|
|
15598
15641
|
return;
|
|
15599
15642
|
}
|
|
15600
15643
|
var newTargetIds = $$.mapToTargetIds(targetIds);
|
|
15601
|
-
svg.selectAll($$.selectorTargets(newTargetIds, ".".concat(
|
|
15644
|
+
svg.selectAll($$.selectorTargets(newTargetIds, ".".concat($ARC.chartArc)))
|
|
15602
15645
|
.selectAll("path")
|
|
15603
15646
|
.transition()
|
|
15604
15647
|
.duration(function (d) { return $$.getExpandConfig(d.data.id, "duration"); })
|
|
15605
15648
|
.attr("d", $$.svgArc);
|
|
15606
|
-
svg.selectAll("".concat(
|
|
15649
|
+
svg.selectAll("".concat($ARC.arc))
|
|
15607
15650
|
.style("opacity", null);
|
|
15608
15651
|
},
|
|
15609
15652
|
/**
|
|
@@ -15669,9 +15712,9 @@ var shapeArc = {
|
|
|
15669
15712
|
var classChartArc = $$.getChartClass("Arc");
|
|
15670
15713
|
var classArcs = $$.getClass("arcs", true);
|
|
15671
15714
|
var classFocus = $$.classFocus.bind($$);
|
|
15672
|
-
var chartArcs = $el.main.select(".".concat(
|
|
15715
|
+
var chartArcs = $el.main.select(".".concat($ARC.chartArcs));
|
|
15673
15716
|
var mainPieUpdate = chartArcs
|
|
15674
|
-
.selectAll(".".concat(
|
|
15717
|
+
.selectAll(".".concat($ARC.chartArc))
|
|
15675
15718
|
.data($$.pie(targets))
|
|
15676
15719
|
.attr("class", function (d) { return classChartArc(d) + classFocus(d.data); });
|
|
15677
15720
|
var mainPieEnter = mainPieUpdate.enter().append("g")
|
|
@@ -15684,16 +15727,16 @@ var shapeArc = {
|
|
|
15684
15727
|
.style("opacity", "0")
|
|
15685
15728
|
.style("text-anchor", "middle")
|
|
15686
15729
|
.style("pointer-events", "none");
|
|
15687
|
-
$el.text = chartArcs.selectAll(".".concat(
|
|
15730
|
+
$el.text = chartArcs.selectAll(".".concat($COMMON.target, " text"));
|
|
15688
15731
|
// MEMO: can not keep same color..., but not bad to update color in redraw
|
|
15689
15732
|
// mainPieUpdate.exit().remove();
|
|
15690
15733
|
},
|
|
15691
15734
|
initArc: function () {
|
|
15692
15735
|
var $$ = this;
|
|
15693
15736
|
var $el = $$.$el;
|
|
15694
|
-
$el.arcs = $el.main.select(".".concat(
|
|
15737
|
+
$el.arcs = $el.main.select(".".concat($COMMON.chart))
|
|
15695
15738
|
.append("g")
|
|
15696
|
-
.attr("class",
|
|
15739
|
+
.attr("class", $ARC.chartArcs)
|
|
15697
15740
|
.attr("transform", $$.getTranslate("arc"));
|
|
15698
15741
|
$$.setArcTitle();
|
|
15699
15742
|
},
|
|
@@ -15707,7 +15750,7 @@ var shapeArc = {
|
|
|
15707
15750
|
var hasGauge = $$.hasType("gauge");
|
|
15708
15751
|
if (title) {
|
|
15709
15752
|
var text = $$.$el.arcs.append("text")
|
|
15710
|
-
.attr("class",
|
|
15753
|
+
.attr("class", hasGauge ? $GAUGE.chartArcsGaugeTitle : $ARC.chartArcsTitle)
|
|
15711
15754
|
.style("text-anchor", "middle");
|
|
15712
15755
|
hasGauge && text.attr("dy", "-0.3em");
|
|
15713
15756
|
setTextValue(text, title, hasGauge ? undefined : [-0.6, 1.35], true);
|
|
@@ -15718,8 +15761,8 @@ var shapeArc = {
|
|
|
15718
15761
|
var config = $$.config, state = $$.state, main = $$.$el.main;
|
|
15719
15762
|
var hasInteraction = config.interaction_enabled;
|
|
15720
15763
|
var isSelectable = hasInteraction && config.data_selection_isselectable;
|
|
15721
|
-
var mainArc = main.selectAll(".".concat(
|
|
15722
|
-
.selectAll(".".concat(
|
|
15764
|
+
var mainArc = main.selectAll(".".concat($ARC.arcs))
|
|
15765
|
+
.selectAll(".".concat($ARC.arc))
|
|
15723
15766
|
.data($$.arcData.bind($$));
|
|
15724
15767
|
mainArc.exit()
|
|
15725
15768
|
.transition()
|
|
@@ -15808,15 +15851,15 @@ var shapeArc = {
|
|
|
15808
15851
|
var isFullCircle = config.gauge_fullCircle;
|
|
15809
15852
|
var startAngle = $$.getStartAngle();
|
|
15810
15853
|
var endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1;
|
|
15811
|
-
var backgroundArc = $$.$el.arcs.select("".concat(hasMultiArcGauge ? "g" : "", ".").concat(
|
|
15854
|
+
var backgroundArc = $$.$el.arcs.select("".concat(hasMultiArcGauge ? "g" : "", ".").concat($ARC.chartArcsBackground));
|
|
15812
15855
|
if (hasMultiArcGauge) {
|
|
15813
15856
|
var index_1 = 0;
|
|
15814
15857
|
backgroundArc = backgroundArc
|
|
15815
|
-
.selectAll("path.".concat(
|
|
15858
|
+
.selectAll("path.".concat($ARC.chartArcsBackground))
|
|
15816
15859
|
.data($$.data.targets);
|
|
15817
15860
|
backgroundArc.enter()
|
|
15818
15861
|
.append("path")
|
|
15819
|
-
.attr("class", function (d, i) { return "".concat(
|
|
15862
|
+
.attr("class", function (d, i) { return "".concat($ARC.chartArcsBackground, " ").concat($ARC.chartArcsBackground, "-").concat(i); })
|
|
15820
15863
|
.merge(backgroundArc)
|
|
15821
15864
|
.style("fill", (config.gauge_background) || null)
|
|
15822
15865
|
.attr("d", function (_a) {
|
|
@@ -15940,10 +15983,10 @@ var shapeArc = {
|
|
|
15940
15983
|
var text;
|
|
15941
15984
|
// for gauge type, update text when has no title & multi data
|
|
15942
15985
|
if (!(hasGauge && $$.data.targets.length === 1 && config.gauge_title)) {
|
|
15943
|
-
text = main.selectAll(".".concat(
|
|
15986
|
+
text = main.selectAll(".".concat($ARC.chartArc))
|
|
15944
15987
|
.select("text")
|
|
15945
15988
|
.style("opacity", "0")
|
|
15946
|
-
.attr("class", function (d) { return ($$.isGaugeType(d.data) ?
|
|
15989
|
+
.attr("class", function (d) { return ($$.isGaugeType(d.data) ? $GAUGE.gaugeValue : null); })
|
|
15947
15990
|
.call($$.textForArcLabel.bind($$))
|
|
15948
15991
|
.attr("transform", $$.transformForArcLabel.bind($$))
|
|
15949
15992
|
.style("font-size", function (d) { return ($$.isGaugeType(d.data) && $$.data.targets.length === 1 && !hasMultiArcGauge ?
|
|
@@ -15953,21 +15996,21 @@ var shapeArc = {
|
|
|
15953
15996
|
.style("opacity", function (d) { return ($$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? null : "0"); });
|
|
15954
15997
|
hasMultiArcGauge && text.attr("dy", "-.1em");
|
|
15955
15998
|
}
|
|
15956
|
-
main.select(".".concat(
|
|
15999
|
+
main.select(".".concat($ARC.chartArcsTitle))
|
|
15957
16000
|
.style("opacity", $$.hasType("donut") || hasGauge ? null : "0");
|
|
15958
16001
|
if (hasGauge) {
|
|
15959
16002
|
var isFullCircle = config.gauge_fullCircle;
|
|
15960
16003
|
isFullCircle && (text === null || text === void 0 ? void 0 : text.attr("dy", "".concat(hasMultiArcGauge ? 0 : Math.round(state.radius / 14))));
|
|
15961
16004
|
if (config.gauge_label_show) {
|
|
15962
|
-
arcs.select(".".concat(
|
|
16005
|
+
arcs.select(".".concat($GAUGE.chartArcsGaugeUnit))
|
|
15963
16006
|
.attr("dy", "".concat(isFullCircle ? 1.5 : 0.75, "em"))
|
|
15964
16007
|
.text(config.gauge_units);
|
|
15965
|
-
arcs.select(".".concat(
|
|
16008
|
+
arcs.select(".".concat($GAUGE.chartArcsGaugeMin))
|
|
15966
16009
|
.attr("dx", "".concat(-1 * (state.innerRadius + ((state.radius - state.innerRadius) / (isFullCircle ? 1 : 2))), "px"))
|
|
15967
16010
|
.attr("dy", "1.2em")
|
|
15968
16011
|
.text($$.textForGaugeMinMax(config.gauge_min, false));
|
|
15969
16012
|
// show max text when isn't fullCircle
|
|
15970
|
-
!isFullCircle && arcs.select(".".concat(
|
|
16013
|
+
!isFullCircle && arcs.select(".".concat($GAUGE.chartArcsGaugeMax))
|
|
15971
16014
|
.attr("dx", "".concat(state.innerRadius + ((state.radius - state.innerRadius) / 2), "px"))
|
|
15972
16015
|
.attr("dy", "1.2em")
|
|
15973
16016
|
.text($$.textForGaugeMinMax(config.gauge_max, true));
|
|
@@ -15985,7 +16028,7 @@ var shapeArea = {
|
|
|
15985
16028
|
var $$ = this;
|
|
15986
16029
|
var config = $$.config;
|
|
15987
16030
|
mainLine
|
|
15988
|
-
.insert("g", ".".concat(
|
|
16031
|
+
.insert("g", ".".concat(config.area_front ? $CIRCLE.circles : $LINE.lines))
|
|
15989
16032
|
.attr("class", $$.getClass("areas", true));
|
|
15990
16033
|
},
|
|
15991
16034
|
updateAreaGradient: function () {
|
|
@@ -16030,8 +16073,8 @@ var shapeArea = {
|
|
|
16030
16073
|
var config = $$.config, state = $$.state, $el = $$.$el, $T = $$.$T;
|
|
16031
16074
|
var $root = isSub ? $el.subchart : $el;
|
|
16032
16075
|
config.area_linearGradient && $$.updateAreaGradient();
|
|
16033
|
-
var area = $root.main.selectAll(".".concat(
|
|
16034
|
-
.selectAll(".".concat(
|
|
16076
|
+
var area = $root.main.selectAll(".".concat($AREA.areas))
|
|
16077
|
+
.selectAll(".".concat($AREA.area))
|
|
16035
16078
|
.data($$.lineData.bind($$));
|
|
16036
16079
|
$T(area.exit(), withTransition)
|
|
16037
16080
|
.style("opacity", "0")
|
|
@@ -16152,10 +16195,10 @@ var shapeArea = {
|
|
|
16152
16195
|
var shapeBar = {
|
|
16153
16196
|
initBar: function () {
|
|
16154
16197
|
var _a = this, $el = _a.$el, config = _a.config, clip = _a.state.clip;
|
|
16155
|
-
$el.bar = $el.main.select(".".concat(
|
|
16198
|
+
$el.bar = $el.main.select(".".concat($COMMON.chart))
|
|
16156
16199
|
// should positioned at the beginning of the shape node to not overlap others
|
|
16157
16200
|
.insert("g", ":first-child")
|
|
16158
|
-
.attr("class",
|
|
16201
|
+
.attr("class", $BAR.chartBars);
|
|
16159
16202
|
// set clip-path attribute when condition meet
|
|
16160
16203
|
// https://github.com/naver/billboard.js/issues/2421
|
|
16161
16204
|
if (config.clipPath === false && (config.bar_radius || config.bar_radius_ratio)) {
|
|
@@ -16172,8 +16215,8 @@ var shapeBar = {
|
|
|
16172
16215
|
if (!$el.bar) {
|
|
16173
16216
|
$$.initBar();
|
|
16174
16217
|
}
|
|
16175
|
-
var mainBarUpdate = $$.$el.main.select(".".concat(
|
|
16176
|
-
.selectAll(".".concat(
|
|
16218
|
+
var mainBarUpdate = $$.$el.main.select(".".concat($BAR.chartBars))
|
|
16219
|
+
.selectAll(".".concat($BAR.chartBar))
|
|
16177
16220
|
.data(
|
|
16178
16221
|
// remove
|
|
16179
16222
|
targets.filter(function (v) { return v.values.some(function (d) { return (isNumber(d.value) || $$.isBarRangeType(d)); }); }))
|
|
@@ -16200,8 +16243,8 @@ var shapeBar = {
|
|
|
16200
16243
|
var $root = isSub ? $el.subchart : $el;
|
|
16201
16244
|
var classBar = $$.getClass("bar", true);
|
|
16202
16245
|
var initialOpacity = $$.initialOpacity.bind($$);
|
|
16203
|
-
var bar = $root.main.selectAll(".".concat(
|
|
16204
|
-
.selectAll(".".concat(
|
|
16246
|
+
var bar = $root.main.selectAll(".".concat($BAR.bars))
|
|
16247
|
+
.selectAll(".".concat($BAR.bar))
|
|
16205
16248
|
.data($$.labelishData.bind($$));
|
|
16206
16249
|
$T(bar.exit(), withTransition)
|
|
16207
16250
|
.style("opacity", "0")
|
|
@@ -16355,10 +16398,10 @@ var shapeBar = {
|
|
|
16355
16398
|
var shapeCandlestick = {
|
|
16356
16399
|
initCandlestick: function () {
|
|
16357
16400
|
var $el = this.$el;
|
|
16358
|
-
$el.candlestick = $el.main.select(".".concat(
|
|
16401
|
+
$el.candlestick = $el.main.select(".".concat($COMMON.chart))
|
|
16359
16402
|
// should positioned at the beginning of the shape node to not overlap others
|
|
16360
16403
|
.append("g")
|
|
16361
|
-
.attr("class",
|
|
16404
|
+
.attr("class", $CANDLESTICK.chartCandlesticks);
|
|
16362
16405
|
},
|
|
16363
16406
|
/**
|
|
16364
16407
|
* Update targets by its data
|
|
@@ -16374,8 +16417,8 @@ var shapeCandlestick = {
|
|
|
16374
16417
|
if (!$el.candlestick) {
|
|
16375
16418
|
$$.initCandlestick();
|
|
16376
16419
|
}
|
|
16377
|
-
var mainUpdate = $$.$el.main.select(".".concat(
|
|
16378
|
-
.selectAll(".".concat(
|
|
16420
|
+
var mainUpdate = $$.$el.main.select(".".concat($CANDLESTICK.chartCandlesticks))
|
|
16421
|
+
.selectAll(".".concat($CANDLESTICK.chartCandlestick))
|
|
16379
16422
|
.data(targets)
|
|
16380
16423
|
.attr("class", function (d) { return classChart(d) + classFocus(d); });
|
|
16381
16424
|
mainUpdate.enter().append("g")
|
|
@@ -16395,8 +16438,8 @@ var shapeCandlestick = {
|
|
|
16395
16438
|
var $root = isSub ? $el.subchart : $el;
|
|
16396
16439
|
var classSetter = $$.getClass("candlestick", true);
|
|
16397
16440
|
var initialOpacity = $$.initialOpacity.bind($$);
|
|
16398
|
-
var candlestick = $root.main.selectAll(".".concat(
|
|
16399
|
-
.selectAll(".".concat(
|
|
16441
|
+
var candlestick = $root.main.selectAll(".".concat($CANDLESTICK.chartCandlestick))
|
|
16442
|
+
.selectAll(".".concat($CANDLESTICK.candlestick))
|
|
16400
16443
|
.data($$.labelishData.bind($$));
|
|
16401
16444
|
$T(candlestick.exit(), withTransition)
|
|
16402
16445
|
.style("opacity", "0")
|
|
@@ -16434,7 +16477,7 @@ var shapeCandlestick = {
|
|
|
16434
16477
|
var indexX = +isRotated;
|
|
16435
16478
|
var indexY = +!indexX;
|
|
16436
16479
|
if (g.classed) {
|
|
16437
|
-
g.classed(
|
|
16480
|
+
g.classed($CANDLESTICK[isUp ? "valueUp" : "valueDown"], true);
|
|
16438
16481
|
}
|
|
16439
16482
|
var path = isRotated ?
|
|
16440
16483
|
"H".concat(points[1][1], " V").concat(points[1][0], " H").concat(points[0][1]) :
|
|
@@ -16584,12 +16627,12 @@ var shapeGauge = {
|
|
|
16584
16627
|
if ($$.hasType("gauge")) {
|
|
16585
16628
|
var hasMulti = $$.hasMultiArcGauge();
|
|
16586
16629
|
arcs.append(hasMulti ? "g" : "path")
|
|
16587
|
-
.attr("class",
|
|
16630
|
+
.attr("class", $ARC.chartArcsBackground)
|
|
16588
16631
|
.style("fill", (!hasMulti && config.gauge_background) || null);
|
|
16589
|
-
config.gauge_units && appendText(
|
|
16632
|
+
config.gauge_units && appendText($GAUGE.chartArcsGaugeUnit);
|
|
16590
16633
|
if (config.gauge_label_show) {
|
|
16591
|
-
appendText(
|
|
16592
|
-
!config.gauge_fullCircle && appendText(
|
|
16634
|
+
appendText($GAUGE.chartArcsGaugeMin);
|
|
16635
|
+
!config.gauge_fullCircle && appendText($GAUGE.chartArcsGaugeMax);
|
|
16593
16636
|
}
|
|
16594
16637
|
}
|
|
16595
16638
|
},
|
|
@@ -16609,12 +16652,12 @@ var shapeGauge = {
|
|
|
16609
16652
|
var $$ = this;
|
|
16610
16653
|
var config = $$.config, state = $$.state, $el = $$.$el;
|
|
16611
16654
|
var hiddenTargetIds = $$.state.hiddenTargetIds;
|
|
16612
|
-
var arcLabelLines = $el.main.selectAll(".".concat(
|
|
16613
|
-
.selectAll(".".concat(
|
|
16655
|
+
var arcLabelLines = $el.main.selectAll(".".concat($ARC.arcs))
|
|
16656
|
+
.selectAll(".".concat($ARC.arcLabelLine))
|
|
16614
16657
|
.data($$.arcData.bind($$));
|
|
16615
16658
|
var mainArcLabelLine = arcLabelLines.enter()
|
|
16616
16659
|
.append("rect")
|
|
16617
|
-
.attr("class", function (d) { return "".concat(
|
|
16660
|
+
.attr("class", function (d) { return "".concat($ARC.arcLabelLine, " ").concat($COMMON.target, " ").concat($COMMON.target, "-").concat(d.data.id); })
|
|
16618
16661
|
.merge(arcLabelLines);
|
|
16619
16662
|
mainArcLabelLine
|
|
16620
16663
|
.style("fill", function (d) { return ($$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data)); })
|
|
@@ -16735,8 +16778,8 @@ var shapeBubble = {
|
|
|
16735
16778
|
var shapeLine = {
|
|
16736
16779
|
initLine: function () {
|
|
16737
16780
|
var $el = this.$el;
|
|
16738
|
-
$el.line = $el.main.select(".".concat(
|
|
16739
|
-
.attr("class",
|
|
16781
|
+
$el.line = $el.main.select(".".concat($COMMON.chart)).append("g")
|
|
16782
|
+
.attr("class", $LINE.chartLines);
|
|
16740
16783
|
},
|
|
16741
16784
|
updateTargetsForLine: function (t) {
|
|
16742
16785
|
var $$ = this;
|
|
@@ -16748,8 +16791,8 @@ var shapeLine = {
|
|
|
16748
16791
|
$$.initLine();
|
|
16749
16792
|
}
|
|
16750
16793
|
var targets = t.filter(function (d) { return !($$.isScatterType(d) || $$.isBubbleType(d)); });
|
|
16751
|
-
var mainLineUpdate = main.select(".".concat(
|
|
16752
|
-
.selectAll(".".concat(
|
|
16794
|
+
var mainLineUpdate = main.select(".".concat($LINE.chartLines))
|
|
16795
|
+
.selectAll(".".concat($LINE.chartLine))
|
|
16753
16796
|
.data(targets)
|
|
16754
16797
|
.attr("class", function (d) { return classChartLine(d) + classFocus(d); });
|
|
16755
16798
|
var mainLineEnter = mainLineUpdate.enter().append("g")
|
|
@@ -16777,8 +16820,8 @@ var shapeLine = {
|
|
|
16777
16820
|
var extraLineClasses = $$.format.extraLineClasses, $el = $$.$el, $T = $$.$T;
|
|
16778
16821
|
var $root = isSub ? $el.subchart : $el;
|
|
16779
16822
|
var line = $root.main
|
|
16780
|
-
.selectAll(".".concat(
|
|
16781
|
-
.selectAll(".".concat(
|
|
16823
|
+
.selectAll(".".concat($LINE.lines))
|
|
16824
|
+
.selectAll(".".concat($LINE.line))
|
|
16782
16825
|
.data($$.lineData.bind($$));
|
|
16783
16826
|
$T(line.exit(), withTransition)
|
|
16784
16827
|
.style("opacity", "0")
|
|
@@ -17023,10 +17066,10 @@ var shapePoint = {
|
|
|
17023
17066
|
var $$ = this;
|
|
17024
17067
|
var main = $$.$el.main;
|
|
17025
17068
|
$$.point = $$.generatePoint();
|
|
17026
|
-
if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select(".".concat(
|
|
17027
|
-
main.select(".".concat(
|
|
17069
|
+
if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select(".".concat($CIRCLE.chartCircles)).empty()) {
|
|
17070
|
+
main.select(".".concat($COMMON.chart))
|
|
17028
17071
|
.append("g")
|
|
17029
|
-
.attr("class",
|
|
17072
|
+
.attr("class", $CIRCLE.chartCircles);
|
|
17030
17073
|
}
|
|
17031
17074
|
},
|
|
17032
17075
|
updateTargetForCircle: function (targetsValue, enterNodeValue) {
|
|
@@ -17046,9 +17089,9 @@ var shapePoint = {
|
|
|
17046
17089
|
if (!targets) {
|
|
17047
17090
|
targets = (data.targets)
|
|
17048
17091
|
.filter(function (d) { return _this.isScatterType(d) || _this.isBubbleType(d); });
|
|
17049
|
-
var mainCircle = $el.main.select(".".concat(
|
|
17092
|
+
var mainCircle = $el.main.select(".".concat($CIRCLE.chartCircles))
|
|
17050
17093
|
.style("pointer-events", "none")
|
|
17051
|
-
.selectAll(".".concat(
|
|
17094
|
+
.selectAll(".".concat($CIRCLE.circles))
|
|
17052
17095
|
.data(targets)
|
|
17053
17096
|
.attr("class", classCircles);
|
|
17054
17097
|
mainCircle.exit().remove();
|
|
@@ -17056,14 +17099,14 @@ var shapePoint = {
|
|
|
17056
17099
|
}
|
|
17057
17100
|
// Circles for each data point on lines
|
|
17058
17101
|
selectionEnabled && enterNode.append("g")
|
|
17059
|
-
.attr("class", function (d) { return $$.generateClass(
|
|
17102
|
+
.attr("class", function (d) { return $$.generateClass($SELECT.selectedCircles, d.id); });
|
|
17060
17103
|
enterNode.append("g")
|
|
17061
17104
|
.attr("class", classCircles)
|
|
17062
17105
|
.style("cursor", function (d) { return (isFunction(isSelectable) && isSelectable(d) ? "pointer" : null); });
|
|
17063
17106
|
// Update date for selected circles
|
|
17064
17107
|
selectionEnabled && targets.forEach(function (t) {
|
|
17065
|
-
$el.main.selectAll(".".concat(
|
|
17066
|
-
.selectAll("".concat(
|
|
17108
|
+
$el.main.selectAll(".".concat($SELECT.selectedCircles).concat($$.getTargetSelectorSuffix(t.id)))
|
|
17109
|
+
.selectAll("".concat($SELECT.selectedCircle))
|
|
17067
17110
|
.each(function (d) {
|
|
17068
17111
|
d.value = t.values[d.index].value;
|
|
17069
17112
|
});
|
|
@@ -17076,8 +17119,8 @@ var shapePoint = {
|
|
|
17076
17119
|
var focusOnly = config.point_focus_only;
|
|
17077
17120
|
var $root = isSub ? $el.subchart : $el;
|
|
17078
17121
|
if (config.point_show && !state.toggling) {
|
|
17079
|
-
var circles = $root.main.selectAll(".".concat(
|
|
17080
|
-
.selectAll(".".concat(
|
|
17122
|
+
var circles = $root.main.selectAll(".".concat($CIRCLE.circles))
|
|
17123
|
+
.selectAll(".".concat($CIRCLE.circle))
|
|
17081
17124
|
.data(function (d) { return (($$.isLineType(d) && $$.shouldDrawPointsForLine(d)) ||
|
|
17082
17125
|
$$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ?
|
|
17083
17126
|
(focusOnly ? [d.values[0]] : d.values) : []); });
|
|
@@ -17085,7 +17128,7 @@ var shapePoint = {
|
|
|
17085
17128
|
circles.enter()
|
|
17086
17129
|
.filter(Boolean)
|
|
17087
17130
|
.append($$.point("create", this, $$.pointR.bind($$), $$.color));
|
|
17088
|
-
$root.circle = $root.main.selectAll(".".concat(
|
|
17131
|
+
$root.circle = $root.main.selectAll(".".concat($CIRCLE.circles, " .").concat($CIRCLE.circle))
|
|
17089
17132
|
.style("stroke", $$.color)
|
|
17090
17133
|
.style("opacity", $$.initialOpacityForCircle.bind($$));
|
|
17091
17134
|
}
|
|
@@ -17095,7 +17138,7 @@ var shapePoint = {
|
|
|
17095
17138
|
var $$ = this;
|
|
17096
17139
|
var rendered = $$.state.rendered, $el = $$.$el, $T = $$.$T;
|
|
17097
17140
|
var $root = isSub ? $el.subchart : $el;
|
|
17098
|
-
var selectedCircles = $root.main.selectAll(".".concat(
|
|
17141
|
+
var selectedCircles = $root.main.selectAll(".".concat($SELECT.selectedCircle));
|
|
17099
17142
|
if (!$$.config.point_show) {
|
|
17100
17143
|
return [];
|
|
17101
17144
|
}
|
|
@@ -17184,7 +17227,7 @@ var shapePoint = {
|
|
|
17184
17227
|
var $$ = this;
|
|
17185
17228
|
var r = $$.pointExpandedR.bind($$);
|
|
17186
17229
|
reset && $$.unexpandCircles();
|
|
17187
|
-
var circles = $$.getShapeByIndex("circle", i, id).classed(
|
|
17230
|
+
var circles = $$.getShapeByIndex("circle", i, id).classed($COMMON.EXPANDED, true);
|
|
17188
17231
|
var scale = r(circles) / $$.config.point_r;
|
|
17189
17232
|
var ratio = 1 - scale;
|
|
17190
17233
|
if ($$.isCirclePoint()) {
|
|
@@ -17211,9 +17254,9 @@ var shapePoint = {
|
|
|
17211
17254
|
var r = $$.pointR.bind($$);
|
|
17212
17255
|
var circles = $$.getShapeByIndex("circle", i)
|
|
17213
17256
|
.filter(function () {
|
|
17214
|
-
return select(this).classed(
|
|
17257
|
+
return select(this).classed($COMMON.EXPANDED);
|
|
17215
17258
|
})
|
|
17216
|
-
.classed(
|
|
17259
|
+
.classed($COMMON.EXPANDED, false);
|
|
17217
17260
|
circles.attr("r", r);
|
|
17218
17261
|
!$$.isCirclePoint() &&
|
|
17219
17262
|
circles.attr("transform", "scale(".concat(r(circles) / $$.config.point_r, ")"));
|
|
@@ -17299,8 +17342,8 @@ var shapePoint = {
|
|
|
17299
17342
|
pointClass = d === true ?
|
|
17300
17343
|
circle.each(function (d) {
|
|
17301
17344
|
var className = $$.getClass("circle", true)(d);
|
|
17302
|
-
if (this.getAttribute("class").indexOf(
|
|
17303
|
-
className += " ".concat(
|
|
17345
|
+
if (this.getAttribute("class").indexOf($COMMON.EXPANDED) > -1) {
|
|
17346
|
+
className += " ".concat($COMMON.EXPANDED);
|
|
17304
17347
|
}
|
|
17305
17348
|
this.setAttribute("class", className);
|
|
17306
17349
|
}) : $$.getClass("circle", true)(d);
|
|
@@ -17481,17 +17524,17 @@ var shapeRadar = {
|
|
|
17481
17524
|
var $$ = this;
|
|
17482
17525
|
var config = $$.config, current = $$.state.current, $el = $$.$el;
|
|
17483
17526
|
if ($$.hasType("radar")) {
|
|
17484
|
-
$el.radar = $el.main.select(".".concat(
|
|
17485
|
-
.attr("class",
|
|
17527
|
+
$el.radar = $el.main.select(".".concat($COMMON.chart)).append("g")
|
|
17528
|
+
.attr("class", $RADAR.chartRadars);
|
|
17486
17529
|
// level
|
|
17487
17530
|
$el.radar.levels = $el.radar.append("g")
|
|
17488
|
-
.attr("class",
|
|
17531
|
+
.attr("class", $RADAR.levels);
|
|
17489
17532
|
// axis
|
|
17490
17533
|
$el.radar.axes = $el.radar.append("g")
|
|
17491
|
-
.attr("class",
|
|
17534
|
+
.attr("class", $AXIS.axis);
|
|
17492
17535
|
// shapes
|
|
17493
17536
|
$el.radar.shapes = $el.radar.append("g")
|
|
17494
|
-
.attr("class",
|
|
17537
|
+
.attr("class", $SHAPE.shapes);
|
|
17495
17538
|
current.dataMax = config.radar_axis_max || $$.getMinMaxData().max[0].value;
|
|
17496
17539
|
}
|
|
17497
17540
|
},
|
|
@@ -17545,7 +17588,7 @@ var shapeRadar = {
|
|
|
17545
17588
|
// Adjust radar, circles and texts' position
|
|
17546
17589
|
if (translate) {
|
|
17547
17590
|
radar.attr("transform", translate);
|
|
17548
|
-
main.select(".".concat(
|
|
17591
|
+
main.select(".".concat($TEXT.chartTexts)).attr("transform", translate);
|
|
17549
17592
|
$$.generateRadarPoints();
|
|
17550
17593
|
$$.updateRadarLevel();
|
|
17551
17594
|
$$.updateRadarAxes();
|
|
@@ -17583,11 +17626,11 @@ var shapeRadar = {
|
|
|
17583
17626
|
return pos.join(" ");
|
|
17584
17627
|
});
|
|
17585
17628
|
var level = radarLevels
|
|
17586
|
-
.selectAll(".".concat(
|
|
17629
|
+
.selectAll(".".concat($RADAR.level))
|
|
17587
17630
|
.data(levelData);
|
|
17588
17631
|
level.exit().remove();
|
|
17589
17632
|
var levelEnter = level.enter().append("g")
|
|
17590
|
-
.attr("class", function (d, i) { return "".concat(
|
|
17633
|
+
.attr("class", function (d, i) { return "".concat($RADAR.level, " ").concat($RADAR.level, "-").concat(i); });
|
|
17591
17634
|
levelEnter.append("polygon")
|
|
17592
17635
|
.style("visibility", config.radar_level_show ? null : "hidden");
|
|
17593
17636
|
if (showText) {
|
|
@@ -17625,7 +17668,7 @@ var shapeRadar = {
|
|
|
17625
17668
|
.data(categories);
|
|
17626
17669
|
axis.exit().remove();
|
|
17627
17670
|
var axisEnter = axis.enter().append("g")
|
|
17628
|
-
.attr("class", function (d, i) { return "".concat(
|
|
17671
|
+
.attr("class", function (d, i) { return "".concat($AXIS.axis, "-").concat(i); });
|
|
17629
17672
|
config.radar_axis_line_show && axisEnter.append("line");
|
|
17630
17673
|
config.radar_axis_text_show && axisEnter.append("text");
|
|
17631
17674
|
axis = axisEnter.merge(axis);
|
|
@@ -18720,10 +18763,10 @@ var apiSelection = {
|
|
|
18720
18763
|
selected: function (targetId) {
|
|
18721
18764
|
var $$ = this.internal;
|
|
18722
18765
|
var dataPoint = [];
|
|
18723
|
-
$$.$el.main.selectAll(".".concat(
|
|
18724
|
-
.selectAll(".".concat(
|
|
18766
|
+
$$.$el.main.selectAll(".".concat($SHAPE.shapes + $$.getTargetSelectorSuffix(targetId)))
|
|
18767
|
+
.selectAll(".".concat($SHAPE.shape))
|
|
18725
18768
|
.filter(function () {
|
|
18726
|
-
return select(this).classed(
|
|
18769
|
+
return select(this).classed($SELECT.SELECTED);
|
|
18727
18770
|
})
|
|
18728
18771
|
.each(function (d) { return dataPoint.push(d); });
|
|
18729
18772
|
return dataPoint;
|
|
@@ -18758,26 +18801,26 @@ var apiSelection = {
|
|
|
18758
18801
|
if (!config.data_selection_enabled) {
|
|
18759
18802
|
return;
|
|
18760
18803
|
}
|
|
18761
|
-
$el.main.selectAll(".".concat(
|
|
18762
|
-
.selectAll(".".concat(
|
|
18804
|
+
$el.main.selectAll(".".concat($SHAPE.shapes))
|
|
18805
|
+
.selectAll(".".concat($SHAPE.shape))
|
|
18763
18806
|
.each(function (d, i) {
|
|
18764
18807
|
var shape = select(this);
|
|
18765
18808
|
var id = d.data ? d.data.id : d.id;
|
|
18766
18809
|
var toggle = $$.getToggle(this, d).bind($$);
|
|
18767
18810
|
var isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0;
|
|
18768
18811
|
var isTargetIndex = !indices || indices.indexOf(i) >= 0;
|
|
18769
|
-
var isSelected = shape.classed(
|
|
18812
|
+
var isSelected = shape.classed($SELECT.SELECTED);
|
|
18770
18813
|
// line/area selection not supported yet
|
|
18771
|
-
if (shape.classed(
|
|
18814
|
+
if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
|
|
18772
18815
|
return;
|
|
18773
18816
|
}
|
|
18774
18817
|
if (isTargetId && isTargetIndex) {
|
|
18775
18818
|
if (config.data_selection_isselectable.bind($$.api)(d) && !isSelected) {
|
|
18776
|
-
toggle(true, shape.classed(
|
|
18819
|
+
toggle(true, shape.classed($SELECT.SELECTED, true), d, i);
|
|
18777
18820
|
}
|
|
18778
18821
|
}
|
|
18779
18822
|
else if (isDefined(resetOther) && resetOther && isSelected) {
|
|
18780
|
-
toggle(false, shape.classed(
|
|
18823
|
+
toggle(false, shape.classed($SELECT.SELECTED, false), d, i);
|
|
18781
18824
|
}
|
|
18782
18825
|
});
|
|
18783
18826
|
},
|
|
@@ -18804,24 +18847,24 @@ var apiSelection = {
|
|
|
18804
18847
|
if (!config.data_selection_enabled) {
|
|
18805
18848
|
return;
|
|
18806
18849
|
}
|
|
18807
|
-
$el.main.selectAll(".".concat(
|
|
18808
|
-
.selectAll(".".concat(
|
|
18850
|
+
$el.main.selectAll(".".concat($SHAPE.shapes))
|
|
18851
|
+
.selectAll(".".concat($SHAPE.shape))
|
|
18809
18852
|
.each(function (d, i) {
|
|
18810
18853
|
var shape = select(this);
|
|
18811
18854
|
var id = d.data ? d.data.id : d.id;
|
|
18812
18855
|
var toggle = $$.getToggle(this, d).bind($$);
|
|
18813
18856
|
var isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0;
|
|
18814
18857
|
var isTargetIndex = !indices || indices.indexOf(i) >= 0;
|
|
18815
|
-
var isSelected = shape.classed(
|
|
18858
|
+
var isSelected = shape.classed($SELECT.SELECTED);
|
|
18816
18859
|
// line/area selection not supported yet
|
|
18817
|
-
if (shape.classed(
|
|
18860
|
+
if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
|
|
18818
18861
|
return;
|
|
18819
18862
|
}
|
|
18820
18863
|
if (isTargetId &&
|
|
18821
18864
|
isTargetIndex &&
|
|
18822
18865
|
config.data_selection_isselectable.bind($$.api)(d) &&
|
|
18823
18866
|
isSelected) {
|
|
18824
|
-
toggle(false, shape.classed(
|
|
18867
|
+
toggle(false, shape.classed($SELECT.SELECTED, false), d, i);
|
|
18825
18868
|
}
|
|
18826
18869
|
});
|
|
18827
18870
|
}
|
|
@@ -18865,12 +18908,12 @@ var apiSubchart = {
|
|
|
18865
18908
|
$$.unbindZoomEvent();
|
|
18866
18909
|
config.subchart_show = !show;
|
|
18867
18910
|
!subchart.main && $$.initSubchart();
|
|
18868
|
-
var $target = subchart.main.selectAll(".".concat(
|
|
18911
|
+
var $target = subchart.main.selectAll(".".concat($COMMON.target));
|
|
18869
18912
|
// need to cover when new data has been loaded
|
|
18870
18913
|
if ($$.data.targets.length !== $target.size()) {
|
|
18871
18914
|
$$.updateSizes();
|
|
18872
18915
|
$$.updateTargetsForSubchart($$.data.targets);
|
|
18873
|
-
$target = subchart.main.selectAll(".".concat(
|
|
18916
|
+
$target = subchart.main.selectAll(".".concat($COMMON.target));
|
|
18874
18917
|
}
|
|
18875
18918
|
$target.style("opacity", null);
|
|
18876
18919
|
subchart.main.style("display", null);
|
|
@@ -19156,28 +19199,28 @@ var drag = {
|
|
|
19156
19199
|
var maxX = Math.max(sx, mx);
|
|
19157
19200
|
var minY = isSelectionGrouped ? state.margin.top : Math.min(sy, my);
|
|
19158
19201
|
var maxY = isSelectionGrouped ? state.height : Math.max(sy, my);
|
|
19159
|
-
main.select(".".concat(
|
|
19202
|
+
main.select(".".concat($DRAG.dragarea))
|
|
19160
19203
|
.attr("x", minX)
|
|
19161
19204
|
.attr("y", minY)
|
|
19162
19205
|
.attr("width", maxX - minX)
|
|
19163
19206
|
.attr("height", maxY - minY);
|
|
19164
19207
|
// TODO: binary search when multiple xs
|
|
19165
|
-
main.selectAll(".".concat(
|
|
19166
|
-
.selectAll(".".concat(
|
|
19208
|
+
main.selectAll(".".concat($SHAPE.shapes))
|
|
19209
|
+
.selectAll(".".concat($SHAPE.shape))
|
|
19167
19210
|
.filter(function (d) { return isSelectable === null || isSelectable === void 0 ? void 0 : isSelectable.bind($$.api)(d); })
|
|
19168
19211
|
.each(function (d, i) {
|
|
19169
19212
|
var shape = select(this);
|
|
19170
|
-
var isSelected = shape.classed(
|
|
19171
|
-
var isIncluded = shape.classed(
|
|
19213
|
+
var isSelected = shape.classed($SELECT.SELECTED);
|
|
19214
|
+
var isIncluded = shape.classed($DRAG.INCLUDED);
|
|
19172
19215
|
var isWithin = false;
|
|
19173
19216
|
var toggle;
|
|
19174
|
-
if (shape.classed(
|
|
19217
|
+
if (shape.classed($CIRCLE.circle)) {
|
|
19175
19218
|
var x = +shape.attr("cx") * 1;
|
|
19176
19219
|
var y = +shape.attr("cy") * 1;
|
|
19177
19220
|
toggle = $$.togglePoint;
|
|
19178
19221
|
isWithin = minX < x && x < maxX && minY < y && y < maxY;
|
|
19179
19222
|
}
|
|
19180
|
-
else if (shape.classed(
|
|
19223
|
+
else if (shape.classed($BAR.bar)) {
|
|
19181
19224
|
var _a = getPathBox(this), x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
19182
19225
|
toggle = $$.togglePath;
|
|
19183
19226
|
isWithin = !(maxX < x || x + width < minX) && !(maxY < y || y + height < minY);
|
|
@@ -19188,9 +19231,9 @@ var drag = {
|
|
|
19188
19231
|
}
|
|
19189
19232
|
// @ts-ignore
|
|
19190
19233
|
if (isWithin ^ isIncluded) {
|
|
19191
|
-
shape.classed(
|
|
19234
|
+
shape.classed($DRAG.INCLUDED, !isIncluded);
|
|
19192
19235
|
// TODO: included/unincluded callback here
|
|
19193
|
-
shape.classed(
|
|
19236
|
+
shape.classed($SELECT.SELECTED, !isSelected);
|
|
19194
19237
|
toggle.call($$, !isSelected, shape, d, i);
|
|
19195
19238
|
}
|
|
19196
19239
|
});
|
|
@@ -19208,9 +19251,9 @@ var drag = {
|
|
|
19208
19251
|
return;
|
|
19209
19252
|
}
|
|
19210
19253
|
state.dragStart = mouse;
|
|
19211
|
-
main.select(".".concat(
|
|
19254
|
+
main.select(".".concat($COMMON.chart))
|
|
19212
19255
|
.append("rect")
|
|
19213
|
-
.attr("class",
|
|
19256
|
+
.attr("class", $DRAG.dragarea)
|
|
19214
19257
|
.style("opacity", "0.1");
|
|
19215
19258
|
$$.setDragStatus(true);
|
|
19216
19259
|
},
|
|
@@ -19225,11 +19268,11 @@ var drag = {
|
|
|
19225
19268
|
if ($$.hasArcType() || !config.data_selection_enabled) { // do nothing if not selectable
|
|
19226
19269
|
return;
|
|
19227
19270
|
}
|
|
19228
|
-
$T(main.select(".".concat(
|
|
19271
|
+
$T(main.select(".".concat($DRAG.dragarea)))
|
|
19229
19272
|
.style("opacity", "0")
|
|
19230
19273
|
.remove();
|
|
19231
|
-
main.selectAll(".".concat(
|
|
19232
|
-
.classed(
|
|
19274
|
+
main.selectAll(".".concat($SHAPE.shape))
|
|
19275
|
+
.classed($DRAG.INCLUDED, false);
|
|
19233
19276
|
$$.setDragStatus(false);
|
|
19234
19277
|
}
|
|
19235
19278
|
};
|
|
@@ -19251,12 +19294,12 @@ var selection = _assign(_assign({}, drag), {
|
|
|
19251
19294
|
var r = $$.pointSelectR.bind($$);
|
|
19252
19295
|
callFn(config.data_onselected, $$.api, d, target.node());
|
|
19253
19296
|
// add selected-circle on low layer g
|
|
19254
|
-
$T(main.select(".".concat(
|
|
19255
|
-
.selectAll(".".concat(
|
|
19297
|
+
$T(main.select(".".concat($SELECT.selectedCircles).concat($$.getTargetSelectorSuffix(d.id)))
|
|
19298
|
+
.selectAll(".".concat($SELECT.selectedCircle, "-").concat(i))
|
|
19256
19299
|
.data([d])
|
|
19257
19300
|
.enter()
|
|
19258
19301
|
.append("circle")
|
|
19259
|
-
.attr("class", function () { return $$.generateClass(
|
|
19302
|
+
.attr("class", function () { return $$.generateClass($SELECT.selectedCircle, i); })
|
|
19260
19303
|
.attr("cx", cx)
|
|
19261
19304
|
.attr("cy", cy)
|
|
19262
19305
|
.attr("stroke", $$.color)
|
|
@@ -19274,8 +19317,8 @@ var selection = _assign(_assign({}, drag), {
|
|
|
19274
19317
|
var config = $$.config, main = $$.$el.main, $T = $$.$T;
|
|
19275
19318
|
callFn(config.data_onunselected, $$.api, d, target.node());
|
|
19276
19319
|
// remove selected-circle from low layer g
|
|
19277
|
-
$T(main.select(".".concat(
|
|
19278
|
-
.selectAll(".".concat(
|
|
19320
|
+
$T(main.select(".".concat($SELECT.selectedCircles).concat($$.getTargetSelectorSuffix(d.id)))
|
|
19321
|
+
.selectAll(".".concat($SELECT.selectedCircle, "-").concat(i)))
|
|
19279
19322
|
.attr("r", 0)
|
|
19280
19323
|
.remove();
|
|
19281
19324
|
},
|
|
@@ -19354,29 +19397,29 @@ var selection = _assign(_assign({}, drag), {
|
|
|
19354
19397
|
toggleShape: function (that, d, i) {
|
|
19355
19398
|
var $$ = this;
|
|
19356
19399
|
var config = $$.config, main = $$.$el.main;
|
|
19357
|
-
var shape = select(that);
|
|
19358
|
-
var isSelected = shape.classed(CLASS.SELECTED);
|
|
19359
|
-
var toggle = $$.getToggle(that, d).bind($$);
|
|
19360
|
-
var toggledShape;
|
|
19361
19400
|
if (config.data_selection_enabled && config.data_selection_isselectable.bind($$.api)(d)) {
|
|
19401
|
+
var shape = select(that);
|
|
19402
|
+
var isSelected = shape.classed($SELECT.SELECTED);
|
|
19403
|
+
var toggle_1 = $$.getToggle(that, d).bind($$);
|
|
19404
|
+
var toggledShape_1;
|
|
19362
19405
|
if (!config.data_selection_multiple) {
|
|
19363
|
-
var selector = ".".concat(
|
|
19406
|
+
var selector = ".".concat($SHAPE.shapes);
|
|
19364
19407
|
if (config.data_selection_grouped) {
|
|
19365
19408
|
selector += $$.getTargetSelectorSuffix(d.id);
|
|
19366
19409
|
}
|
|
19367
19410
|
main.selectAll(selector)
|
|
19368
|
-
.selectAll(".".concat(
|
|
19411
|
+
.selectAll(".".concat($SHAPE.shape))
|
|
19369
19412
|
.each(function (d, i) {
|
|
19370
19413
|
var shape = select(this);
|
|
19371
|
-
if (shape.classed(
|
|
19372
|
-
|
|
19373
|
-
|
|
19414
|
+
if (shape.classed($SELECT.SELECTED)) {
|
|
19415
|
+
toggledShape_1 = shape;
|
|
19416
|
+
toggle_1(false, shape.classed($SELECT.SELECTED, false), d, i);
|
|
19374
19417
|
}
|
|
19375
19418
|
});
|
|
19376
19419
|
}
|
|
19377
|
-
if (!
|
|
19378
|
-
shape.classed(
|
|
19379
|
-
|
|
19420
|
+
if (!toggledShape_1 || toggledShape_1.node() !== shape.node()) {
|
|
19421
|
+
shape.classed($SELECT.SELECTED, !isSelected);
|
|
19422
|
+
toggle_1(!isSelected, shape, d, i);
|
|
19380
19423
|
}
|
|
19381
19424
|
}
|
|
19382
19425
|
} });
|
|
@@ -19941,7 +19984,7 @@ var zoom = {
|
|
|
19941
19984
|
if (!zoomRect) {
|
|
19942
19985
|
zoomRect = $$.$el.main.append("rect")
|
|
19943
19986
|
.attr("clip-path", state.clip.path)
|
|
19944
|
-
.attr("class",
|
|
19987
|
+
.attr("class", $ZOOM.zoomBrush)
|
|
19945
19988
|
.attr("width", isRotated ? state.width : 0)
|
|
19946
19989
|
.attr("height", isRotated ? 0 : state.height);
|
|
19947
19990
|
}
|
|
@@ -19985,13 +20028,13 @@ var zoom = {
|
|
|
19985
20028
|
if (resetButton && config.zoom_type === "drag") {
|
|
19986
20029
|
if (!$el.zoomResetBtn) {
|
|
19987
20030
|
$el.zoomResetBtn = $$.$el.chart.append("div")
|
|
19988
|
-
.classed(
|
|
20031
|
+
.classed($COMMON.button, true)
|
|
19989
20032
|
.append("span")
|
|
19990
20033
|
.on("click", function () {
|
|
19991
20034
|
isFunction(resetButton.onclick) && resetButton.onclick.bind($$.api)(this);
|
|
19992
20035
|
$$.api.unzoom();
|
|
19993
20036
|
})
|
|
19994
|
-
.classed(
|
|
20037
|
+
.classed($ZOOM.buttonZoomReset, true)
|
|
19995
20038
|
.text(resetButton.text || "Reset Zoom");
|
|
19996
20039
|
}
|
|
19997
20040
|
else {
|
|
@@ -20322,7 +20365,7 @@ var zoomModule = function () {
|
|
|
20322
20365
|
var defaults = {};
|
|
20323
20366
|
/**
|
|
20324
20367
|
* @namespace bb
|
|
20325
|
-
* @version 3.3.
|
|
20368
|
+
* @version 3.3.1
|
|
20326
20369
|
*/
|
|
20327
20370
|
var bb = {
|
|
20328
20371
|
/**
|
|
@@ -20332,7 +20375,7 @@ var bb = {
|
|
|
20332
20375
|
* bb.version; // "1.0.0"
|
|
20333
20376
|
* @memberof bb
|
|
20334
20377
|
*/
|
|
20335
|
-
version: "3.3.
|
|
20378
|
+
version: "3.3.1",
|
|
20336
20379
|
/**
|
|
20337
20380
|
* Generate chart
|
|
20338
20381
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|