billboard.js 3.17.2 → 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 (49) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +25 -15
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +12 -12
  5. package/dist/billboard.pkgd.js +2127 -1610
  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 +16 -4
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -4
  11. package/dist/plugin/billboardjs-plugin-stanford.js +16 -4
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
  13. package/dist/plugin/billboardjs-plugin-tableview.js +18 -8
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +16 -4
  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 +2178 -1659
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -8
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2179 -1660
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +12 -10
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2182 -1665
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +11 -9
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2181 -1662
  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 +27 -16
  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 +2 -2
  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/internals/color.ts +4 -6
  45. package/src/ChartInternal/internals/legend.ts +2 -1
  46. package/src/ChartInternal/internals/tooltip.ts +2 -2
  47. package/src/ChartInternal/shape/point.common.ts +4 -4
  48. package/src/Plugin/tableview/index.ts +2 -5
  49. package/src/module/util.ts +24 -6
@@ -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.2
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.2
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.2
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.2
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.2
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.2
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.2
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.2
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.2
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.2
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.2
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';
@@ -2423,16 +2423,27 @@ function endall(transition, cb) {
2423
2423
  transition.call(end);
2424
2424
  }
2425
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
+ };
2426
2433
  /**
2427
- * Replace tag sign to html entity
2434
+ * Sanitize HTML string to prevent XSS attacks
2428
2435
  * @param {string} str Target string value
2429
- * @returns {string}
2436
+ * @returns {string} Sanitized string with dangerous elements removed
2430
2437
  * @private
2431
2438
  */
2432
2439
  function sanitize(str) {
2433
- return isString(str) ?
2434
- str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") :
2435
- 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=\"\"");
2436
2447
  }
2437
2448
  /**
2438
2449
  * Set text value. If there's multiline add nodes.
@@ -2986,7 +2997,7 @@ function tplProcess(tpl, data) {
2986
2997
  for (var x in data) {
2987
2998
  res = res.replace(new RegExp("{=".concat(x, "}"), "g"), data[x]);
2988
2999
  }
2989
- return res;
3000
+ return sanitize(res);
2990
3001
  }
2991
3002
  /**
2992
3003
  * Get parsed date value
@@ -5786,7 +5797,7 @@ var color = {
5786
5797
  }
5787
5798
  ids.forEach(function (v) {
5788
5799
  var id = "".concat(state.datetimeId, "-labels-bg").concat($$.getTargetSelectorSuffix(v)).concat(isString(color) ? $$.getTargetSelectorSuffix(color) : "");
5789
- 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]) || "");
5790
5801
  if (defs.select("#".concat(id)).empty()) {
5791
5802
  defs.append("filter")
5792
5803
  .attr("x", attr.x)
@@ -6474,7 +6485,7 @@ var legend$1 = {
6474
6485
  var html_1 = "";
6475
6486
  targets.forEach(function (v) {
6476
6487
  var content = isFunction(template) ?
6477
- template.bind($$.api)(v, $$.color(v), $$.api.data(v)[0].values) :
6488
+ sanitize(template.call($$.api, v, $$.color(v), $$.api.data(v)[0].values)) :
6478
6489
  tplProcess(template, {
6479
6490
  COLOR: $$.color(v),
6480
6491
  TITLE: v
@@ -9194,11 +9205,11 @@ var tooltip$1 = {
9194
9205
  callFn(config.tooltip_onshow, $$.api, selectedData);
9195
9206
  // set tooltip content
9196
9207
  tooltip
9197
- .html($$.getTooltipHTML(selectedData, // data
9208
+ .html(sanitize($$.getTooltipHTML(selectedData, // data
9198
9209
  $$.axis ? $$.axis.getXAxisTickFormat() : $$.categoryName.bind($$), // defaultTitleFormat
9199
9210
  $$.getDefaultValueFormat(), // defaultValueFormat
9200
9211
  $$.color // color
9201
- ))
9212
+ )))
9202
9213
  .style("display", null)
9203
9214
  .style("visibility", null) // for IE9
9204
9215
  .datum(datum = {
@@ -21442,7 +21453,7 @@ function insertPointInfoDefs(point, id) {
21442
21453
  target.setAttribute(name_1, from.getAttribute(name_1));
21443
21454
  }
21444
21455
  };
21445
- var doc$1 = new DOMParser().parseFromString(point, "image/svg+xml");
21456
+ var doc$1 = new DOMParser().parseFromString(sanitize(point), "image/svg+xml");
21446
21457
  var node = doc$1.documentElement;
21447
21458
  var clone = doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
21448
21459
  clone.id = id;
@@ -21452,7 +21463,7 @@ function insertPointInfoDefs(point, id) {
21452
21463
  if ((_a = node.childNodes) === null || _a === void 0 ? void 0 : _a.length) {
21453
21464
  var parent_1 = select(clone);
21454
21465
  if ("innerHTML" in clone) {
21455
- parent_1.html(node.innerHTML);
21466
+ parent_1.html(sanitize(node.innerHTML));
21456
21467
  }
21457
21468
  else {
21458
21469
  toArray(node.childNodes).forEach(function (v) {
@@ -21514,7 +21525,7 @@ var shapePointCommon = {
21514
21525
  var pointId = $$.getDefsPointId(id);
21515
21526
  var defsPoint = $el.defs.select("#".concat(pointId));
21516
21527
  if (defsPoint.size() < 1) {
21517
- insertPointInfoDefs.bind($$)(point, pointId);
21528
+ insertPointInfoDefs.call($$, point, pointId);
21518
21529
  }
21519
21530
  if (method === "create") {
21520
21531
  return (_b = $$.custom) === null || _b === void 0 ? void 0 : _b.create.bind(context).apply(void 0, __spreadArray([element, pointId], args, false));
@@ -25595,7 +25606,7 @@ var zoomModule = function () {
25595
25606
  var defaults = Object.create(null);
25596
25607
  /**
25597
25608
  * @namespace bb
25598
- * @version 3.17.2
25609
+ * @version 3.17.3
25599
25610
  */
25600
25611
  var bb = {
25601
25612
  /**
@@ -25605,7 +25616,7 @@ var bb = {
25605
25616
  * bb.version; // "1.0.0"
25606
25617
  * @memberof bb
25607
25618
  */
25608
- version: "3.17.2",
25619
+ version: "3.17.3",
25609
25620
  /**
25610
25621
  * Generate chart
25611
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.2
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.2";
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.2
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.2";
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.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -440,7 +440,7 @@ var Plugin = /** @class */ (function () {
440
440
  delete _this[key];
441
441
  });
442
442
  };
443
- Plugin.version = "3.17.2";
443
+ Plugin.version = "3.17.3";
444
444
  return Plugin;
445
445
  }());
446
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.2
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.2";
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.2
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.2";
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.2",
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"
@@ -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 {
@@ -175,16 +175,34 @@ function endall(transition, cb: Function): void {
175
175
  }
176
176
  }
177
177
 
178
+ // Sanitize regular expressions (compiled once for performance)
179
+ const dangerousTags =
180
+ "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
181
+ const sanitizeRx = {
182
+ tags: new RegExp(
183
+ `<(${dangerousTags})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${dangerousTags})[^>]*\\/?>`,
184
+ "gi"
185
+ ),
186
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
187
+ dangerousUrls:
188
+ /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
189
+ };
190
+
178
191
  /**
179
- * Replace tag sign to html entity
192
+ * Sanitize HTML string to prevent XSS attacks
180
193
  * @param {string} str Target string value
181
- * @returns {string}
194
+ * @returns {string} Sanitized string with dangerous elements removed
182
195
  * @private
183
196
  */
184
197
  function sanitize(str: string): string {
185
- return isString(str) ?
186
- str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") :
187
- str;
198
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
199
+ return str;
200
+ }
201
+
202
+ return str
203
+ .replace(sanitizeRx.tags, "")
204
+ .replace(sanitizeRx.eventHandlers, "")
205
+ .replace(sanitizeRx.dangerousUrls, "$1=\"\"");
188
206
  }
189
207
 
190
208
  /**
@@ -817,7 +835,7 @@ function tplProcess(tpl: string, data: object): string {
817
835
  res = res.replace(new RegExp(`{=${x}}`, "g"), data[x]);
818
836
  }
819
837
 
820
- return res;
838
+ return sanitize(res);
821
839
  }
822
840
 
823
841
  /**