billboard.js 3.17.1 → 3.17.3

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.
Files changed (50) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +33 -20
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +12 -12
  5. package/dist/billboard.pkgd.js +2135 -1615
  6. package/dist/billboard.pkgd.min.js +21 -19
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +23 -5
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -4
  11. package/dist/plugin/billboardjs-plugin-stanford.js +23 -5
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
  13. package/dist/plugin/billboardjs-plugin-tableview.js +25 -9
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +23 -5
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -4
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2168 -1661
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +8 -6
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2170 -1645
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -8
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2171 -1646
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +12 -10
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2174 -1651
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +11 -9
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2173 -1648
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +10 -8
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/billboard.js +35 -18
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +9 -3
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +27 -6
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +3 -3
  44. package/src/ChartInternal/data/convert.ts +10 -2
  45. package/src/ChartInternal/internals/color.ts +4 -6
  46. package/src/ChartInternal/internals/legend.ts +2 -1
  47. package/src/ChartInternal/internals/tooltip.ts +2 -2
  48. package/src/ChartInternal/shape/point.common.ts +4 -4
  49. package/src/Plugin/tableview/index.ts +2 -5
  50. package/src/module/util.ts +32 -7
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */
10
10
  /*-- Dark Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */.bb-color-pattern{background-image:url(#4a7fff;#b02c2c;#1ca46c;#b47300;#49baf3;#ed7e13;#cfaa00;#a6cd19;#dccb52;#f5d194;)}.bb svg{font-size:12px;font-family:Helvetica,Arial,sans-serif,nanumgothic,Dotum;line-height:1}.bb path,.bb line{fill:none;stroke:#8d9cab}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:#8d9cab;font-size:11px}.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid-focus,.bb-ygrid,.bb-line{shape-rendering:crispEdges}.bb-chart-arcs .bb-needle{fill:#8d9cab}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{fill:#fff}.bb-axis{shape-rendering:crispEdges}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:.9em;fill:#fff;white-space:nowrap}.bb-axis-y text,.bb-axis-y2 text{fill:#8d9cab}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:#27c9030d}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#5c666e}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ccd9e6}.bb-text.bb-empty{fill:#8d9cab}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:2px;stroke:8d9cab}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:1px}.selection{stroke:none;fill:#ccd9e6}.bb-selected-circle{fill:#ccd9e6;stroke-width:2px}.bb-bar{stroke-width:.5px}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.5!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-region rect{fill-opacity:.5}.bb-region.selected rect{fill:#27c903}.bb-zoom-brush{fill-opacity:.25;fill:#ccd9e6}.bb-brush .extent{fill-opacity:.5}.bb-legend-item{user-select:none}.bb-legend-item line{stroke-width:10px;stroke-dasharray:3px}.bb-legend-item text{transform:translateY(-1px)}.bb-legend-item-hidden{opacity:.5}.bb-legend-background{opacity:.75;stroke:#d3d3d3;stroke-width:1}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#8d9cab;stroke-width:1px}.bb-tooltip-container{z-index:10;font-family:Helvetica,Arial,sans-serif,nanumgothic,Dotum;user-select:none;transform:translateZ(0)}.bb-tooltip{border-collapse:separate;border-spacing:0;empty-cells:show;border:1px solid #828181;border-radius:5px;background-color:#000;text-align:left;font-size:11px;color:#fff;white-space:nowrap}.bb-tooltip th{font-size:12px;padding:4px 8px;text-align:left;border-bottom:solid 1px #828181}.bb-tooltip td{padding:4px 6px}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:7px;height:7px;margin:-1px 6px 0 0;vertical-align:middle}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{display:inline-block;color:#aaa;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;line-height:13px;padding:4px 0 3px;color:#444;text-align:left;font-weight:400}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{padding-left:5px;font-weight:800;font-size:12px}.bb-area{stroke-width:0;opacity:.5}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#3f3f3f;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#828181;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-min,.bb-chart-arcs .bb-chart-arcs-gauge-max{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{font-size:16px!important;fill:#b6c2ce;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#b6c2ce}.bb-chart-arc rect{stroke:#8d9cab;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{border:solid 1px #ccc;background-color:#000;color:#fff;padding:5px;border-radius:5px;cursor:pointer}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */
10
10
  /*-- Datalab Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */.bb-color-pattern{background-image:url(#2ac4b3;#feaf29;#ff617b;#73a2ef;#b180d0;#3064cf;#d0a45f;#8aaec7;#ef65a2;#8aaec7;)}.bb svg{font-size:11px;font-family:Sans Pro,Arial,sans-serif,nanumgothic,Dotum;line-height:1}.bb path,.bb line{fill:none;stroke:#000}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-font-smoothing:antialiased;user-select:none;fill:#555;font-size:11px}.bb-chart-arcs .bb-needle{fill:#000}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{fill:#fff}.bb-axis{stroke-width:.7px}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:.9em;fill:#fff;white-space:nowrap}.bb-axis-y text,.bb-axis-y2 text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:#27c9030d}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:.7px}.bb-circle{fill:#fff!important}.bb-circle._expanded_{stroke-width:2px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:1px}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.3!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-region rect{fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-zoom-brush,.bb-brush .extent{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item line.bb-legend-item-tile{stroke-linecap:round;stroke-width:8px;transform:translate(7px,1px);stroke-dasharray:1 20}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#000;stroke-width:1px}.bb-tooltip-container{z-index:10;font-family:Sans Pro,Arial,sans-serif,nanumgothic,Dotum;user-select:none;transform:translateZ(0)}.bb-tooltip{border-collapse:separate;border-spacing:0;border-radius:2px;empty-cells:show;border:1px solid #999;background-color:#fff;text-align:left;font-size:11px;-webkit-font-smoothing:antialiased;white-space:nowrap}.bb-tooltip th{font-size:13px;padding:2px 8px;text-align:left;border-bottom:solid 2px #ff2d2d;background-color:#0b00b1;color:#fffdfd}.bb-tooltip td{padding:4px 6px}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:8px;height:8px;margin-right:6px;border:solid 1px #000;border-radius:3px;vertical-align:middle}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{display:inline-block;color:#aaa;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;line-height:13px;padding:4px 0 3px;color:#444;text-align:left;font-weight:400}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{padding-left:5px;font-weight:800;font-size:11px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:18px}.bb-chart-arcs .bb-chart-arcs-gauge-min,.bb-chart-arcs .bb-chart-arcs-gauge-max{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{font-size:18px!important;fill:#000;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-line{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value{fill:#3b6969}.bb-chart-arc path{stroke:#000;stroke-width:.5px}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:14px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:.7px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{border:solid 1px #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */
10
10
  /*-- Graph Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */.bb-color-pattern{background-image:url(#65CFC2;#D0A45F;#64A4F5;#EF65A2;#A377FE;#8AAEC7;#FF7E5A;#898EFE;#FFAC35;#70B0FF;)}.bb svg{font-size:12px;font-family:Helvetica,Apple SD Gothic Neo,Arial,sans-serif,nanumgothic,Dotum;line-height:1}.bb path,.bb line{fill:none;stroke:#8c8c8c}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:#555;font-size:12px;letter-spacing:-.3px}.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-chart-arcs .bb-needle{fill:#000}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{fill:#fff}.bb-axis{shape-rendering:crispEdges}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:.9em;fill:#fff;white-space:nowrap}.bb-axis-y text,.bb-axis-y2 text{fill:#8c8c8c}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:#27c9030d}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ffb6b6;stroke-dasharray:3px}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:2px}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:2px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.3!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-region rect{fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-zoom-brush,.bb-brush .extent{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1px}.bb-legend-item line{stroke-dasharray:1px}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{z-index:10;font-family:Helvetica,Apple SD Gothic Neo,Arial,sans-serif,nanumgothic,Dotum;user-select:none;transform:translateZ(0)}.bb-tooltip{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-collapse:separate;border-spacing:0;empty-cells:show;border:1px solid #999;border-radius:2px;background-color:#fff;text-align:left;font-size:12px;box-shadow:.5px .5px 1px #999;white-space:nowrap}.bb-tooltip th{font-size:12px;padding:4px 8px;text-align:center;border-bottom:dotted 1px #000;background-color:#efefef;color:#000}.bb-tooltip tr:last-child td{border-bottom:none}.bb-tooltip td{padding:3px 6px;background-color:#fff;border-bottom:solid 1px #eee}.bb-tooltip td:first-child{padding-left:5px;border-right:solid 1px #eee}.bb-tooltip td:last-child{padding-right:5px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:5px;height:12px;margin-right:6px;vertical-align:middle}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{display:inline-block;color:#aaa;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:1px;font-size:12px}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{line-height:13px;padding:4px 0 3px;color:#444;text-align:left;font-weight:400}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{padding-left:5px;font-weight:800}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-min,.bb-chart-arcs .bb-chart-arcs-gauge-max{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{font-size:16px!important;fill:#8c8c8c;font-style:italic}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#8c8c8c;font-style:italic}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px;font-weight:700}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#8c8c8c;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#8c8c8c}.bb-chart-radars .bb-axis line{stroke:#8c8c8c;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;font-weight:700;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{border:solid 1px #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer;opacity:.8;box-shadow:1px 1px 2px #ccc}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */
10
10
  /*-- Insight Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */.bb-color-pattern{background-image:url(#00c73c;#fa7171;#2ad0ff;#7294ce;#e3e448;#cc7e6e;#fb6ccf;#c98dff;#4aea99;#bbbbbb;)}.bb svg{font-size:12px;font-family:sans-serif,Arial,nanumgothic,Dotum;line-height:1}.bb path,.bb line{fill:none;stroke:#c4c4c4}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:#555;font-size:11px}.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-chart-arcs .bb-needle{fill:#000}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{fill:#fff}.bb-axis{shape-rendering:crispEdges}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:.9em;fill:#fff;white-space:nowrap}.bb-axis-y text,.bb-axis-y2 text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:#27c9030d}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_{fill:#fff!important;stroke-width:2px;stroke:red}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:1px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.3!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-region rect{fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-zoom-brush,.bb-brush .extent{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{z-index:10;font-family:sans-serif,Arial,nanumgothic,Dotum;user-select:none;transform:translateZ(0)}.bb-tooltip{border-collapse:separate;border-spacing:0;empty-cells:show;border:1px solid #999;background-color:#fff;text-align:left;font-size:11px;white-space:nowrap}.bb-tooltip th{font-size:12px;padding:4px 8px;text-align:left;border-bottom:solid 1px #eee}.bb-tooltip td{padding:4px 6px;background-color:#fff}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:10px;height:10px;margin-right:6px;border-radius:5px;vertical-align:middle}.bb-tooltip td.value{border-left:1px solid transparent}.bb-tooltip .bb-tooltip-title{display:inline-block;color:#aaa;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;line-height:13px;padding:4px 0 3px;color:#444;text-align:left;font-weight:400}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{padding-left:5px;font-weight:800;font-size:12px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-min,.bb-chart-arcs .bb-chart-arcs-gauge-max{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{font-size:16px!important;fill:#000;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{border:solid 1px #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */
10
10
  @charset "UTF-8";
11
11
  /*-- Insight Theme --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */.bb-color-pattern{background-image:url(#7ea9fa;#ffcd1e;#d33043;#41c464;#c86b74;#006bc2;#2a7e41;#f27c00;#c159ff;#bed017;)}.bb svg{font-size:12px;font-family:-apple-system,"system-ui",Noto Sans,Malgun Gothic,\b9d1\c740 \ace0\b515,helvetica,Apple SD Gothic Neo,sans-serif;line-height:1}.bb path,.bb line{fill:none;stroke:#cecece}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:#555;font-size:10.5px}.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-chart-arcs .bb-needle{fill:#000}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{fill:#fff}.bb-axis{shape-rendering:crispEdges}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:.9em;fill:#fff;white-space:nowrap}.bb-axis-y text,.bb-axis-y2 text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:#27c9030d}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#d2bad8}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:2px;stroke:red}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:1px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.3!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#71808d}.bb-region rect{fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-zoom-brush{fill-opacity:.1;fill:#838181}.bb-brush .extent{fill-opacity:.1}.bb-brush .selection{fill:#838181;fill-opacity:.2}.bb-brush path{stroke:#838181}.bb-legend-item{user-select:none}.bb-legend-item line.bb-legend-item-tile{stroke-linecap:round;transform:translate(7px,1px);stroke-dasharray:1 20}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#000;stroke-width:.5px}.bb-tooltip-container{z-index:10;font-family:-apple-system,"system-ui",Noto Sans,Malgun Gothic,\b9d1\c740 \ace0\b515,helvetica,Apple SD Gothic Neo,sans-serif;user-select:none;transform:translateZ(0)}.bb-tooltip{border-collapse:separate;border-spacing:0;empty-cells:show;border:1px solid #999;color:#fff;border-radius:5px;background-color:#404244;text-align:left;font-size:11px;white-space:nowrap;opacity:.9}.bb-tooltip th{font-size:11px;padding:3px 6px 0;text-align:left}.bb-tooltip td{padding:3px}.bb-tooltip td:first-child{padding-left:7px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:5px;vertical-align:middle}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{display:inline-block;color:#aaa;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;line-height:13px;padding:4px 0 3px;color:#444;text-align:left;font-weight:400}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{padding-left:5px;font-weight:800;font-size:12px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#ccc}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-min,.bb-chart-arcs .bb-chart-arcs-gauge-max{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{font-size:1.8em;fill:#000;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#cecece;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:11px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#cecece;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#cecece;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{border:1px solid #999;background-color:#404244;color:#fff;opacity:.9;padding:5px;border-radius:5px;cursor:pointer}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  */
10
10
  import { pointer, select, namespaces, selectAll } from 'd3-selection';
11
11
  import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
@@ -2331,9 +2331,15 @@ var ceil10 = function (v) { return Math.ceil(v / 10) * 10; };
2331
2331
  var asHalfPixel = function (n) { return Math.ceil(n) + 0.5; };
2332
2332
  var diffDomain = function (d) { return d[1] - d[0]; };
2333
2333
  var isObjectType = function (v) { return typeof v === "object"; };
2334
+ var isEmptyObject = function (obj) {
2335
+ for (var x in obj) {
2336
+ return false;
2337
+ }
2338
+ return true;
2339
+ };
2334
2340
  var isEmpty = function (o) { return (isUndefined(o) || o === null ||
2335
2341
  (isString(o) && o.length === 0) ||
2336
- (isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0) ||
2342
+ (isObjectType(o) && !(o instanceof Date) && isEmptyObject(o)) ||
2337
2343
  (isNumber(o) && isNaN(o))); };
2338
2344
  var notEmpty = function (o) { return !isEmpty(o); };
2339
2345
  /**
@@ -2417,16 +2423,27 @@ function endall(transition, cb) {
2417
2423
  transition.call(end);
2418
2424
  }
2419
2425
  }
2426
+ // Sanitize regular expressions (compiled once for performance)
2427
+ var dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
2428
+ var sanitizeRx = {
2429
+ tags: new RegExp("<(".concat(dangerousTags, ")[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(").concat(dangerousTags, ")[^>]*\\/?>"), "gi"),
2430
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
2431
+ dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
2432
+ };
2420
2433
  /**
2421
- * Replace tag sign to html entity
2434
+ * Sanitize HTML string to prevent XSS attacks
2422
2435
  * @param {string} str Target string value
2423
- * @returns {string}
2436
+ * @returns {string} Sanitized string with dangerous elements removed
2424
2437
  * @private
2425
2438
  */
2426
2439
  function sanitize(str) {
2427
- return isString(str) ?
2428
- str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") :
2429
- str;
2440
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
2441
+ return str;
2442
+ }
2443
+ return str
2444
+ .replace(sanitizeRx.tags, "")
2445
+ .replace(sanitizeRx.eventHandlers, "")
2446
+ .replace(sanitizeRx.dangerousUrls, "$1=\"\"");
2430
2447
  }
2431
2448
  /**
2432
2449
  * Set text value. If there's multiline add nodes.
@@ -2980,7 +2997,7 @@ function tplProcess(tpl, data) {
2980
2997
  for (var x in data) {
2981
2998
  res = res.replace(new RegExp("{=".concat(x, "}"), "g"), data[x]);
2982
2999
  }
2983
- return res;
3000
+ return sanitize(res);
2984
3001
  }
2985
3002
  /**
2986
3003
  * Get parsed date value
@@ -4069,7 +4086,7 @@ var dataConvert = {
4069
4086
  */
4070
4087
  convertData: function (args, callback) {
4071
4088
  var config = this.config;
4072
- var useWorker = function (d) { var _a; return (d === null || d === void 0 ? void 0 : d.length) && ((_a = d[0]) === null || _a === void 0 ? void 0 : _a.length) ? config.boost_useWorker : false; };
4089
+ var useWorker = function (d) { return (d === null || d === void 0 ? void 0 : d.length) && !isEmpty(d[0]) ? config.boost_useWorker : false; };
4073
4090
  var data = args;
4074
4091
  if (args.bindto) {
4075
4092
  data = {};
@@ -5780,7 +5797,7 @@ var color = {
5780
5797
  }
5781
5798
  ids.forEach(function (v) {
5782
5799
  var id = "".concat(state.datetimeId, "-labels-bg").concat($$.getTargetSelectorSuffix(v)).concat(isString(color) ? $$.getTargetSelectorSuffix(color) : "");
5783
- var colorValue = v === "" ? color : (color === null || color === void 0 ? void 0 : color[v]) || "";
5800
+ var colorValue = sanitize(v === "" ? color : (color === null || color === void 0 ? void 0 : color[v]) || "");
5784
5801
  if (defs.select("#".concat(id)).empty()) {
5785
5802
  defs.append("filter")
5786
5803
  .attr("x", attr.x)
@@ -6468,7 +6485,7 @@ var legend$1 = {
6468
6485
  var html_1 = "";
6469
6486
  targets.forEach(function (v) {
6470
6487
  var content = isFunction(template) ?
6471
- template.bind($$.api)(v, $$.color(v), $$.api.data(v)[0].values) :
6488
+ sanitize(template.call($$.api, v, $$.color(v), $$.api.data(v)[0].values)) :
6472
6489
  tplProcess(template, {
6473
6490
  COLOR: $$.color(v),
6474
6491
  TITLE: v
@@ -9188,11 +9205,11 @@ var tooltip$1 = {
9188
9205
  callFn(config.tooltip_onshow, $$.api, selectedData);
9189
9206
  // set tooltip content
9190
9207
  tooltip
9191
- .html($$.getTooltipHTML(selectedData, // data
9208
+ .html(sanitize($$.getTooltipHTML(selectedData, // data
9192
9209
  $$.axis ? $$.axis.getXAxisTickFormat() : $$.categoryName.bind($$), // defaultTitleFormat
9193
9210
  $$.getDefaultValueFormat(), // defaultValueFormat
9194
9211
  $$.color // color
9195
- ))
9212
+ )))
9196
9213
  .style("display", null)
9197
9214
  .style("visibility", null) // for IE9
9198
9215
  .datum(datum = {
@@ -21436,7 +21453,7 @@ function insertPointInfoDefs(point, id) {
21436
21453
  target.setAttribute(name_1, from.getAttribute(name_1));
21437
21454
  }
21438
21455
  };
21439
- var doc$1 = new DOMParser().parseFromString(point, "image/svg+xml");
21456
+ var doc$1 = new DOMParser().parseFromString(sanitize(point), "image/svg+xml");
21440
21457
  var node = doc$1.documentElement;
21441
21458
  var clone = doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
21442
21459
  clone.id = id;
@@ -21446,7 +21463,7 @@ function insertPointInfoDefs(point, id) {
21446
21463
  if ((_a = node.childNodes) === null || _a === void 0 ? void 0 : _a.length) {
21447
21464
  var parent_1 = select(clone);
21448
21465
  if ("innerHTML" in clone) {
21449
- parent_1.html(node.innerHTML);
21466
+ parent_1.html(sanitize(node.innerHTML));
21450
21467
  }
21451
21468
  else {
21452
21469
  toArray(node.childNodes).forEach(function (v) {
@@ -21508,7 +21525,7 @@ var shapePointCommon = {
21508
21525
  var pointId = $$.getDefsPointId(id);
21509
21526
  var defsPoint = $el.defs.select("#".concat(pointId));
21510
21527
  if (defsPoint.size() < 1) {
21511
- insertPointInfoDefs.bind($$)(point, pointId);
21528
+ insertPointInfoDefs.call($$, point, pointId);
21512
21529
  }
21513
21530
  if (method === "create") {
21514
21531
  return (_b = $$.custom) === null || _b === void 0 ? void 0 : _b.create.bind(context).apply(void 0, __spreadArray([element, pointId], args, false));
@@ -25589,7 +25606,7 @@ var zoomModule = function () {
25589
25606
  var defaults = Object.create(null);
25590
25607
  /**
25591
25608
  * @namespace bb
25592
- * @version 3.17.1
25609
+ * @version 3.17.3
25593
25610
  */
25594
25611
  var bb = {
25595
25612
  /**
@@ -25599,7 +25616,7 @@ var bb = {
25599
25616
  * bb.version; // "1.0.0"
25600
25617
  * @memberof bb
25601
25618
  */
25602
- version: "3.17.1",
25619
+ version: "3.17.3",
25603
25620
  /**
25604
25621
  * Generate chart
25605
25622
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -100,7 +100,7 @@ var Plugin = /** @class */ (function () {
100
100
  delete _this[key];
101
101
  });
102
102
  };
103
- Plugin.version = "3.17.1";
103
+ Plugin.version = "3.17.3";
104
104
  return Plugin;
105
105
  }());
106
106
 
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -376,7 +376,7 @@ var Plugin = /** @class */ (function () {
376
376
  delete _this[key];
377
377
  });
378
378
  };
379
- Plugin.version = "3.17.1";
379
+ Plugin.version = "3.17.3";
380
380
  return Plugin;
381
381
  }());
382
382
 
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -261,9 +261,15 @@ var isNumber = function (v) { return typeof v === "number"; };
261
261
  var isUndefined = function (v) { return typeof v === "undefined"; };
262
262
  var isDefined = function (v) { return typeof v !== "undefined"; };
263
263
  var isObjectType = function (v) { return typeof v === "object"; };
264
+ var isEmptyObject = function (obj) {
265
+ for (var x in obj) {
266
+ return false;
267
+ }
268
+ return true;
269
+ };
264
270
  var isEmpty = function (o) { return (isUndefined(o) || o === null ||
265
271
  (isString(o) && o.length === 0) ||
266
- (isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0) ||
272
+ (isObjectType(o) && !(o instanceof Date) && isEmptyObject(o)) ||
267
273
  (isNumber(o) && isNaN(o))); };
268
274
  /**
269
275
  * Get range
@@ -434,7 +440,7 @@ var Plugin = /** @class */ (function () {
434
440
  delete _this[key];
435
441
  });
436
442
  };
437
- Plugin.version = "3.17.1";
443
+ Plugin.version = "3.17.3";
438
444
  return Plugin;
439
445
  }());
440
446
 
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -75,9 +75,32 @@ function getGlobal() {
75
75
  var win = getGlobal();
76
76
  var doc = win === null || win === void 0 ? void 0 : win.document;
77
77
 
78
+ var isString = function (v) { return typeof v === "string"; };
78
79
  var isNumber = function (v) { return typeof v === "number"; };
79
80
  var isDefined = function (v) { return typeof v !== "undefined"; };
80
81
  var isObjectType = function (v) { return typeof v === "object"; };
82
+ // Sanitize regular expressions (compiled once for performance)
83
+ var dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
84
+ var sanitizeRx = {
85
+ tags: new RegExp("<(".concat(dangerousTags, ")[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(").concat(dangerousTags, ")[^>]*\\/?>"), "gi"),
86
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
87
+ dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
88
+ };
89
+ /**
90
+ * Sanitize HTML string to prevent XSS attacks
91
+ * @param {string} str Target string value
92
+ * @returns {string} Sanitized string with dangerous elements removed
93
+ * @private
94
+ */
95
+ function sanitize(str) {
96
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
97
+ return str;
98
+ }
99
+ return str
100
+ .replace(sanitizeRx.tags, "")
101
+ .replace(sanitizeRx.eventHandlers, "")
102
+ .replace(sanitizeRx.dangerousUrls, "$1=\"\"");
103
+ }
81
104
  // emulate event
82
105
  ({
83
106
  mouse: (function () {
@@ -121,7 +144,7 @@ function tplProcess(tpl, data) {
121
144
  for (var x in data) {
122
145
  res = res.replace(new RegExp("{=".concat(x, "}"), "g"), data[x]);
123
146
  }
124
- return res;
147
+ return sanitize(res);
125
148
  }
126
149
 
127
150
  /**
@@ -217,7 +240,7 @@ var Plugin = /** @class */ (function () {
217
240
  delete _this[key];
218
241
  });
219
242
  };
220
- Plugin.version = "3.17.1";
243
+ Plugin.version = "3.17.3";
221
244
  return Plugin;
222
245
  }());
223
246
 
@@ -465,9 +488,7 @@ var TableView = /** @class */ (function (_super) {
465
488
  });
466
489
  }).join(""), "</tr>");
467
490
  });
468
- var rx = /(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig;
469
- var r = tplProcess(tpl.body, __assign(__assign({}, config), { title: config.title || $$.config.title_text || "", thead: thead, tbody: tbody })).replace(rx, "");
470
- element.innerHTML = r;
491
+ element.innerHTML = tplProcess(tpl.body, __assign(__assign({}, config), { title: config.title || $$.config.title_text || "", thead: thead, tbody: tbody }));
471
492
  };
472
493
  TableView.prototype.$redraw = function () {
473
494
  var state = this.$$.state;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -204,7 +204,7 @@ var Plugin = /** @class */ (function () {
204
204
  delete _this[key];
205
205
  });
206
206
  };
207
- Plugin.version = "3.17.1";
207
+ Plugin.version = "3.17.3";
208
208
  return Plugin;
209
209
  }());
210
210
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billboard.js",
3
- "version": "3.17.1",
3
+ "version": "3.17.3",
4
4
  "description": "Re-usable easy interface JavaScript chart library, based on D3 v4+",
5
5
  "homepage": "https://naver.github.io/billboard.js/",
6
6
  "main": "dist/billboard.js",
@@ -46,7 +46,7 @@
46
46
  "jsdoc": "node ./config/jsdoc.js",
47
47
  "jsdoc:cmd": "jsdoc -c jsdoc.json",
48
48
  "lint-staged": "lint-staged --config ./config/.lintstagedrc.json",
49
- "prepare": "husky install"
49
+ "prepare": "husky"
50
50
  },
51
51
  "sideEffects": [
52
52
  "dist/**/*.css",
@@ -54,7 +54,7 @@
54
54
  ],
55
55
  "repository": {
56
56
  "type": "git",
57
- "url": "https://github.com/naver/billboard.js"
57
+ "url": "git+https://github.com/naver/billboard.js.git"
58
58
  },
59
59
  "bugs": {
60
60
  "url": "https://github.com/naver/billboard.js/issues"
@@ -2,7 +2,15 @@
2
2
  * Copyright (c) 2017 ~ present NAVER Corp.
3
3
  * billboard.js project is licensed under the MIT license
4
4
  */
5
- import {isArray, isDefined, isObject, isUndefined, isValue, notEmpty} from "../../module/util";
5
+ import {
6
+ isArray,
7
+ isDefined,
8
+ isEmpty,
9
+ isObject,
10
+ isUndefined,
11
+ isValue,
12
+ notEmpty
13
+ } from "../../module/util";
6
14
  import {runWorker} from "../../module/worker";
7
15
  import type {IData} from "../data/IData";
8
16
  import {columns, json, rows, url} from "./convert.helper";
@@ -92,7 +100,7 @@ export default {
92
100
  */
93
101
  convertData(args, callback: Function): void {
94
102
  const {config} = this;
95
- const useWorker = d => d?.length && d[0]?.length ? config.boost_useWorker : false;
103
+ const useWorker = d => d?.length && !isEmpty(d[0]) ? config.boost_useWorker : false;
96
104
  let data = args;
97
105
 
98
106
  if (args.bindto) {
@@ -8,7 +8,7 @@ import {d3Selection} from "../../../types";
8
8
  import {$ARC, $COLOR, $SHAPE} from "../../config/classes";
9
9
  import {document} from "../../module/browser";
10
10
  import {KEY} from "../../module/Cache";
11
- import {isFunction, isObject, isString, notEmpty} from "../../module/util";
11
+ import {isFunction, isObject, isString, notEmpty, sanitize} from "../../module/util";
12
12
  import type {IArcData, IDataRow} from "../data/IData";
13
13
 
14
14
  /**
@@ -206,7 +206,7 @@ export default {
206
206
  const id = `${state.datetimeId}-labels-bg${$$.getTargetSelectorSuffix(v)}${
207
207
  isString(color) ? $$.getTargetSelectorSuffix(color) : ""
208
208
  }`;
209
- const colorValue = v === "" ? color : color?.[v] || "";
209
+ const colorValue = sanitize(v === "" ? color : color?.[v] || "");
210
210
 
211
211
  if (defs.select(`#${id}`).empty()) {
212
212
  defs.append("filter")
@@ -215,10 +215,8 @@ export default {
215
215
  .attr("width", attr.width)
216
216
  .attr("height", attr.height)
217
217
  .attr("id", id)
218
- .html(
219
- `<feFlood flood-color="${colorValue}" />
220
- <feComposite in="SourceGraphic" />`
221
- );
218
+ .html(`<feFlood flood-color="${colorValue}" />
219
+ <feComposite in="SourceGraphic" />`);
222
220
  }
223
221
  });
224
222
  }
@@ -13,6 +13,7 @@ import {
13
13
  isEmpty,
14
14
  isFunction,
15
15
  notEmpty,
16
+ sanitize,
16
17
  tplProcess
17
18
  } from "../../module/util";
18
19
 
@@ -143,7 +144,7 @@ export default {
143
144
 
144
145
  targets.forEach(v => {
145
146
  const content = isFunction(template) ?
146
- template.bind($$.api)(v, $$.color(v), $$.api.data(v)[0].values) :
147
+ sanitize(template.call($$.api, v, $$.color(v), $$.api.data(v)[0].values)) :
147
148
  tplProcess(template, {
148
149
  COLOR: $$.color(v),
149
150
  TITLE: v
@@ -524,12 +524,12 @@ export default {
524
524
 
525
525
  // set tooltip content
526
526
  tooltip
527
- .html($$.getTooltipHTML(
527
+ .html(sanitize($$.getTooltipHTML(
528
528
  selectedData, // data
529
529
  $$.axis ? $$.axis.getXAxisTickFormat() : $$.categoryName.bind($$), // defaultTitleFormat
530
530
  $$.getDefaultValueFormat(), // defaultValueFormat
531
531
  $$.color // color
532
- ))
532
+ )))
533
533
  .style("display", null)
534
534
  .style("visibility", null) // for IE9
535
535
  .datum(datum = {
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import {namespaces as d3Namespaces, select as d3Select} from "d3-selection";
6
6
  import {document} from "../../module/browser";
7
- import {isFunction, isObjectType, notEmpty, toArray} from "../../module/util";
7
+ import {isFunction, isObjectType, notEmpty, sanitize, toArray} from "../../module/util";
8
8
 
9
9
  /**
10
10
  * Check if point draw methods are valid
@@ -34,7 +34,7 @@ function insertPointInfoDefs(point: string, id: string): void {
34
34
  }
35
35
  };
36
36
 
37
- const doc = new DOMParser().parseFromString(point, "image/svg+xml");
37
+ const doc = new DOMParser().parseFromString(sanitize(point), "image/svg+xml");
38
38
  const node = doc.documentElement;
39
39
  const clone = document.createElementNS(d3Namespaces.svg, node.nodeName.toLowerCase());
40
40
 
@@ -48,7 +48,7 @@ function insertPointInfoDefs(point: string, id: string): void {
48
48
  const parent = d3Select(clone);
49
49
 
50
50
  if ("innerHTML" in clone) {
51
- parent.html(node.innerHTML);
51
+ parent.html(sanitize(node.innerHTML));
52
52
  } else {
53
53
  toArray(node.childNodes).forEach(v => {
54
54
  copyAttr(v, parent.append(v.tagName).node());
@@ -114,7 +114,7 @@ export default {
114
114
  const defsPoint = $el.defs.select(`#${pointId}`);
115
115
 
116
116
  if (defsPoint.size() < 1) {
117
- insertPointInfoDefs.bind($$)(point, pointId);
117
+ insertPointInfoDefs.call($$, point, pointId);
118
118
  }
119
119
 
120
120
  if (method === "create") {
@@ -142,15 +142,12 @@ export default class TableView extends Plugin {
142
142
  }</tr>`;
143
143
  });
144
144
 
145
- const rx = /(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig;
146
- const r = tplProcess(tpl.body, {
145
+ element.innerHTML = tplProcess(tpl.body, {
147
146
  ...config,
148
147
  title: config.title || $$.config.title_text || "",
149
148
  thead,
150
149
  tbody
151
- }).replace(rx, "");
152
-
153
- element.innerHTML = r;
150
+ });
154
151
  }
155
152
 
156
153
  $redraw(): void {