@hpcc-js/chart 2.76.1 → 2.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,16 +18,17 @@ This package is part of the mono repository "@hpcc-js" (aka Visualization Framew
18
18
  * [WordCloud](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/misc/Word%20Cloud.js)
19
19
 
20
20
  ## Stand-alone HTML Example
21
- ```html
22
- <html>
21
+
22
+ <ClientOnly>
23
+ <hpcc-preview content_selector="pre > code" style="width:100%;height:600px">
23
24
  <head>
24
25
  <title>Simple Bar Chart</title>
25
- <script src="https://unpkg.com/@hpcc-js/common"></script>
26
- <script src="https://unpkg.com/@hpcc-js/api"></script>
27
- <script src="https://unpkg.com/@hpcc-js/chart"></script>
26
+ <script src="https://cdn.jsdelivr.net/npm/@hpcc-js/common"></script>
27
+ <script src="https://cdn.jsdelivr.net/npm/@hpcc-js/api"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/@hpcc-js/chart"></script>
28
29
  </head>
29
30
  <body>
30
- <div id="placeholder" style="width:800px;height:600px;"></div>
31
+ <div id="placeholder" style="height:300px;"></div>
31
32
  <script>
32
33
  var chart = new window["@hpcc-js/chart"].Bar()
33
34
  .target("placeholder")
@@ -41,7 +42,8 @@ This package is part of the mono repository "@hpcc-js" (aka Visualization Framew
41
42
  .render();
42
43
  </script>
43
44
  </body>
44
- </html>
45
+ </hpcc-preview>
46
+ </ClientOnly>
45
47
  ```
46
48
 
47
49
  ## Getting Started with @hpccjs
@@ -49,3 +51,34 @@ This package is part of the mono repository "@hpcc-js" (aka Visualization Framew
49
51
  * _[Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials)_
50
52
  * _[Gallery](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html)_ ([alt](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html))
51
53
  * _[Wiki](https://github.com/hpcc-systems/Visualization/wiki)_
54
+
55
+ <ClientOnly>
56
+ <hpcc-vitepress style="width:100%;height:600px">
57
+ <div id="target" style="width:100%;height:400px">
58
+ </div>
59
+ <script type="module">
60
+ import { Contour } from "@hpcc-js/chart";
61
+
62
+ new Contour()
63
+ .target("target")
64
+ .columns(["A", "B"])
65
+ .data([
66
+ [10, 10],
67
+ [20, 20],
68
+ [20, 30],
69
+ [30, 20],
70
+ [40, 30],
71
+ [30, 40],
72
+ [10, 20],
73
+ [20, 10]
74
+ ])
75
+ .contourBandwidth(80)
76
+ .contourStrokeWidth(0)
77
+ .yAxisType("linear")
78
+ .xAxisType("ordinal")
79
+ .xAxisTitle("A")
80
+ .render()
81
+ ;
82
+ </script>
83
+ </hpcc-vitepress>
84
+ </ClientOnly>
package/dist/index.es6.js CHANGED
@@ -3,8 +3,8 @@ import { select, scaleTime, timeParse, timeFormat, scaleLog, format, scalePow, s
3
3
  import { normalizeRadians, degreesToRadians } from '@hpcc-js/util';
4
4
 
5
5
  var PKG_NAME = "@hpcc-js/chart";
6
- var PKG_VERSION = "2.76.1";
7
- var BUILD_VERSION = "2.102.4";
6
+ var PKG_VERSION = "2.77.0";
7
+ var BUILD_VERSION = "2.102.11";
8
8
 
9
9
  /*! *****************************************************************************
10
10
  Copyright (c) Microsoft Corporation.
@@ -2464,7 +2464,6 @@ var XYAxis = /** @class */ (function (_super) {
2464
2464
  var currSel = brushSelection(this.focusChart.svgBrush.node());
2465
2465
  if (currSel) {
2466
2466
  if (this.focusChart.xAxisType() !== "ordinal") {
2467
- console.log(JSON.stringify([this.focusChart.xAxis.invert(currSel[0]), this.focusChart.xAxis.invert(currSel[1])]));
2468
2467
  this.xAxis.domain([this.focusChart.xAxis.invert(currSel[0]), this.focusChart.xAxis.invert(currSel[1])]);
2469
2468
  }
2470
2469
  else {
@@ -2560,7 +2559,7 @@ var XYAxis = /** @class */ (function (_super) {
2560
2559
  };
2561
2560
  // Events ---
2562
2561
  XYAxis.prototype.click = function (row, column, selected) {
2563
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
2562
+ // console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
2564
2563
  };
2565
2564
  return XYAxis;
2566
2565
  }(SVGWidget));
@@ -4457,10 +4456,10 @@ var Bullet = /** @class */ (function (_super) {
4457
4456
  };
4458
4457
  // Events ---
4459
4458
  Bullet.prototype.click = function (row, column, selected) {
4460
- console.log("Click: " + JSON.stringify(row) + ", " + column + "," + selected);
4459
+ // console.log("Click: " + JSON.stringify(row) + ", " + column + "," + selected);
4461
4460
  };
4462
4461
  Bullet.prototype.dblclick = function (row, column, selected) {
4463
- console.log("Double click: " + JSON.stringify(row) + ", " + column + "," + selected);
4462
+ // console.log("Double click: " + JSON.stringify(row) + ", " + column + "," + selected);
4464
4463
  };
4465
4464
  __decorate([
4466
4465
  publish(null, "set", "Title Column", function () { return this.columns(); }, { optional: true }),
@@ -8563,6 +8562,26 @@ var Pie = /** @class */ (function (_super) {
8563
8562
  }
8564
8563
  return label;
8565
8564
  };
8565
+ Pie.prototype.selection = function (_) {
8566
+ var _a;
8567
+ if (!arguments.length) {
8568
+ try {
8569
+ return (_a = this._selection.selection2()[0]) === null || _a === void 0 ? void 0 : _a.data;
8570
+ }
8571
+ catch (e) {
8572
+ return undefined;
8573
+ }
8574
+ }
8575
+ // Stringify to enable a deep equal
8576
+ var strRow = JSON.stringify(_);
8577
+ this._selection.selection2(function (d) { return strRow === JSON.stringify(d.data); });
8578
+ };
8579
+ Pie.prototype.selectByLabel = function (_) {
8580
+ var row = this.data().filter(function (row) { return row[0] === _; })[0];
8581
+ if (row) {
8582
+ this.selection(row);
8583
+ }
8584
+ };
8566
8585
  Pie.prototype.enter = function (_domNode, element) {
8567
8586
  _super.prototype.enter.call(this, _domNode, element);
8568
8587
  this._selection.widgetElement(element);
@@ -9274,10 +9293,10 @@ var HexBin = /** @class */ (function (_super) {
9274
9293
  };
9275
9294
  // Events ---
9276
9295
  HexBin.prototype.click = function (row, column, selected) {
9277
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
9296
+ // console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
9278
9297
  };
9279
9298
  HexBin.prototype.dblclick = function (row, column, selected) {
9280
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
9299
+ // console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
9281
9300
  };
9282
9301
  HexBin.__inputs = [{
9283
9302
  id: "x",