@hpcc-js/other 3.5.4 → 3.5.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/other",
3
- "version": "3.5.4",
3
+ "version": "3.5.6",
4
4
  "description": "hpcc-js - Viz Other",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
@@ -23,10 +23,12 @@
23
23
  "scripts": {
24
24
  "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
25
25
  "bundle": "vite build",
26
- "bundle-watch": "vite --port 5515",
26
+ "bundle-watch": "vite build --watch",
27
+ "bundle-serve": "vite --port 5515",
27
28
  "gen-types": "tsc --project tsconfig.json",
28
29
  "gen-types-watch": "npm run gen-types -- --watch",
29
30
  "build": "run-p gen-types bundle",
31
+ "watch": "run-p gen-types-watch bundle-watch",
30
32
  "lint": "eslint ./src",
31
33
  "lint-fix": "eslint --fix src/**/*.ts",
32
34
  "docs": "typedoc --options tdoptions.json .",
@@ -37,12 +39,12 @@
37
39
  "update-major": "npx --yes npm-check-updates -u"
38
40
  },
39
41
  "dependencies": {
40
- "@hpcc-js/api": "^3.4.15",
41
- "@hpcc-js/common": "^3.7.5",
42
- "@hpcc-js/layout": "^3.5.10"
42
+ "@hpcc-js/api": "^3.4.17",
43
+ "@hpcc-js/common": "^3.7.7",
44
+ "@hpcc-js/layout": "^3.5.12"
43
45
  },
44
46
  "devDependencies": {
45
- "@hpcc-js/esbuild-plugins": "^1.8.7",
47
+ "@hpcc-js/esbuild-plugins": "^1.8.8",
46
48
  "d3-array": "^1",
47
49
  "d3-collection": "^1",
48
50
  "d3-format": "^1",
@@ -67,5 +69,5 @@
67
69
  "url": "https://github.com/hpcc-systems/Visualization/issues"
68
70
  },
69
71
  "homepage": "https://github.com/hpcc-systems/Visualization",
70
- "gitHead": "f8bdd58fc6914054a2313a87bbe1257dc9720545"
72
+ "gitHead": "630e839917f1cc38f6e3324db5a9ac991234599a"
71
73
  }
package/src/Audio.ts CHANGED
@@ -1,86 +1,86 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
- import { timer as d3Timer } from "d3-timer";
3
-
4
- export class Audio extends HTMLWidget {
5
- _sections;
6
-
7
- constructor() {
8
- super();
9
- this._tag = "audio";
10
-
11
- this._sections = {};
12
- }
13
-
14
- section(label, offset, beatLength, beatCount) {
15
- if (!arguments.length) return this._sections;
16
- if (arguments.length === 1) return this._sections[label];
17
- this._sections[label] = {
18
- label,
19
- offset,
20
- beatLength,
21
- beatCount,
22
- endOffset: offset + beatCount * beatLength
23
- };
24
- return this;
25
- }
26
-
27
- getType(fileExt) {
28
- switch (fileExt) {
29
- case "mp3":
30
- return "audio/mpeg; codecs='mp3'";
31
- case "ogg":
32
- return "audio/ogg; codecs='vorbis'";
33
- }
34
- return "";
35
- }
36
-
37
- enter(domNode, element) {
38
- const context = this;
39
- element.on("play", function (d) { context.onPlay(d); });
40
- }
41
-
42
- update(domNode, element) {
43
- const source = element.selectAll("source").data(this.source(), function (d) { return d; });
44
- source.enter().append("source")
45
- .attr("src", function (d) { return d; })
46
- ;
47
- }
48
-
49
- createTimer(params, startTime, beat) {
50
- const context = this;
51
- d3Timer(function () {
52
- context.onTick(params.label, beat, params);
53
- return true;
54
- }, beat * params.beatLength, startTime + params.offset);
55
- }
56
-
57
- onTick(label, beat, params) {
58
- }
59
-
60
- onPlay(d) {
61
- const startTime = Date.now();
62
- for (const key in this._sections) {
63
- const section = this._sections[key];
64
- for (let i = 0; i < section.beatCount; ++i) {
65
- this.createTimer(section, startTime, i);
66
- }
67
- }
68
- }
69
-
70
- play(d) {
71
- const context = this;
72
- this._element.on("canplaythrough", function (d2) {
73
- context.node().play();
74
- });
75
- this.node().load();
76
- }
77
- }
78
- Audio.prototype._class += " other_Audio";
79
-
80
- export interface Audio {
81
- source(): string;
82
- source(_: string): this;
83
- source_exists(): boolean;
84
- }
85
-
86
- Audio.prototype.publish("source", "", "string", "Audio Source");
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+ import { timer as d3Timer } from "d3-timer";
3
+
4
+ export class Audio extends HTMLWidget {
5
+ _sections;
6
+
7
+ constructor() {
8
+ super();
9
+ this._tag = "audio";
10
+
11
+ this._sections = {};
12
+ }
13
+
14
+ section(label, offset, beatLength, beatCount) {
15
+ if (!arguments.length) return this._sections;
16
+ if (arguments.length === 1) return this._sections[label];
17
+ this._sections[label] = {
18
+ label,
19
+ offset,
20
+ beatLength,
21
+ beatCount,
22
+ endOffset: offset + beatCount * beatLength
23
+ };
24
+ return this;
25
+ }
26
+
27
+ getType(fileExt) {
28
+ switch (fileExt) {
29
+ case "mp3":
30
+ return "audio/mpeg; codecs='mp3'";
31
+ case "ogg":
32
+ return "audio/ogg; codecs='vorbis'";
33
+ }
34
+ return "";
35
+ }
36
+
37
+ enter(domNode, element) {
38
+ const context = this;
39
+ element.on("play", function (d) { context.onPlay(d); });
40
+ }
41
+
42
+ update(domNode, element) {
43
+ const source = element.selectAll("source").data(this.source(), function (d) { return d; });
44
+ source.enter().append("source")
45
+ .attr("src", function (d) { return d; })
46
+ ;
47
+ }
48
+
49
+ createTimer(params, startTime, beat) {
50
+ const context = this;
51
+ d3Timer(function () {
52
+ context.onTick(params.label, beat, params);
53
+ return true;
54
+ }, beat * params.beatLength, startTime + params.offset);
55
+ }
56
+
57
+ onTick(label, beat, params) {
58
+ }
59
+
60
+ onPlay(d) {
61
+ const startTime = Date.now();
62
+ for (const key in this._sections) {
63
+ const section = this._sections[key];
64
+ for (let i = 0; i < section.beatCount; ++i) {
65
+ this.createTimer(section, startTime, i);
66
+ }
67
+ }
68
+ }
69
+
70
+ play(d) {
71
+ const context = this;
72
+ this._element.on("canplaythrough", function (d2) {
73
+ context.node().play();
74
+ });
75
+ this.node().load();
76
+ }
77
+ }
78
+ Audio.prototype._class += " other_Audio";
79
+
80
+ export interface Audio {
81
+ source(): string;
82
+ source(_: string): this;
83
+ source_exists(): boolean;
84
+ }
85
+
86
+ Audio.prototype.publish("source", "", "string", "Audio Source");
@@ -1,48 +1,48 @@
1
- .other_autoCompleteText label {
2
- display: inline-block;
3
- vertical-align: top;
4
- }
5
-
6
- .other_autoCompleteText input {
7
- width: 100%;
8
- max-width: 600px;
9
- outline: 0;
10
- border-radius: 100;
11
- }
12
-
13
- .autocomplete-suggestions {
14
- text-align: left;
15
- cursor: default;
16
- border: 1px solid #ccc;
17
- border-top: 0;
18
- background: #fff;
19
- box-shadow: -1px 1px 3px rgba(0, 0, 0, .1);
20
- /* core styles should not be changed */
21
- position: absolute;
22
- display: none;
23
- z-index: 9999;
24
- max-height: 254px;
25
- overflow: hidden;
26
- overflow-y: auto;
27
- box-sizing: border-box;
28
- }
29
-
30
- .autocomplete-suggestion {
31
- position: relative;
32
- padding: 0 .6em;
33
- line-height: 23px;
34
- white-space: nowrap;
35
- overflow: hidden;
36
- text-overflow: ellipsis;
37
- font-size: 1.02em;
38
- color: #333;
39
- }
40
-
41
- .autocomplete-suggestion b {
42
- font-weight: normal;
43
- color: #1f8dd6;
44
- }
45
-
46
- .autocomplete-suggestion.selected {
47
- background: #f0f0f0;
1
+ .other_autoCompleteText label {
2
+ display: inline-block;
3
+ vertical-align: top;
4
+ }
5
+
6
+ .other_autoCompleteText input {
7
+ width: 100%;
8
+ max-width: 600px;
9
+ outline: 0;
10
+ border-radius: 100;
11
+ }
12
+
13
+ .autocomplete-suggestions {
14
+ text-align: left;
15
+ cursor: default;
16
+ border: 1px solid #ccc;
17
+ border-top: 0;
18
+ background: #fff;
19
+ box-shadow: -1px 1px 3px rgba(0, 0, 0, .1);
20
+ /* core styles should not be changed */
21
+ position: absolute;
22
+ display: none;
23
+ z-index: 9999;
24
+ max-height: 254px;
25
+ overflow: hidden;
26
+ overflow-y: auto;
27
+ box-sizing: border-box;
28
+ }
29
+
30
+ .autocomplete-suggestion {
31
+ position: relative;
32
+ padding: 0 .6em;
33
+ line-height: 23px;
34
+ white-space: nowrap;
35
+ overflow: hidden;
36
+ text-overflow: ellipsis;
37
+ font-size: 1.02em;
38
+ color: #333;
39
+ }
40
+
41
+ .autocomplete-suggestion b {
42
+ font-weight: normal;
43
+ color: #1f8dd6;
44
+ }
45
+
46
+ .autocomplete-suggestion.selected {
47
+ background: #f0f0f0;
48
48
  }
@@ -1,132 +1,132 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
- import AutoComplete from "javascript-autocomplete";
3
-
4
- import "../src/AutoCompleteText.css";
5
-
6
- export class AutoCompleteText extends HTMLWidget {
7
- _span;
8
- _prompt;
9
- _input;
10
- _prevMinCharsText;
11
- _autoComplete;
12
-
13
- constructor() {
14
- super();
15
- this._tag = "div";
16
- }
17
-
18
- autoCompleteTextData() {
19
- if (this.data().length === 0) return [];
20
- const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
21
- return view.entries().map(function (row, idx) {
22
- return {
23
- idx,
24
- text: row.key,
25
- value: row.values.length ? row.values[0].key : "",
26
- origRow: row.values.length && row.values[0].value.length ? row.values[0].value[0] : []
27
- };
28
- }, this);
29
- }
30
-
31
- enter(domNode, element) {
32
- super.enter(domNode, element);
33
- this._span = element.append("span");
34
- this._prompt = this._span.append("label")
35
- .attr("for", this.id() + "_input")
36
- ;
37
- this._input = this._span.append("input")
38
- .attr("id", this.id() + "_input")
39
- .attr("name", this.id() + "_input_name")
40
- .attr("type", "text")
41
- .attr("placeholder", this.placeholder())
42
- ;
43
- }
44
-
45
- update(domNode, element) {
46
- super.update(domNode, element);
47
-
48
- this._prompt.text(this.label());
49
- this._input.style("width", this.textboxWidth_exists() ? this.textboxWidth() + "px" : null);
50
-
51
- if (this._prevMinCharsText !== this.minCharsText()) {
52
- this._prevMinCharsText = this.minCharsText();
53
-
54
- if (this._autoComplete) {
55
- this._autoComplete.destroy();
56
- }
57
- const context = this;
58
- this._autoComplete = new AutoComplete({
59
- selector: "#" + this.id() + "_input",
60
- minChars: this.minCharsText(),
61
- delay: 150,
62
- offsetLeft: 0,
63
- offsetTop: 1,
64
- source: (term, suggest) => {
65
- const field = context._db.fieldByLabel(context.textColumn());
66
- if (field) {
67
- term = term.toLowerCase();
68
- const suggestions = context.autoCompleteTextData().filter(function (row) {
69
- return row.origRow[field.idx].toLowerCase().indexOf(term) >= 0;
70
- }).map(function (row) {
71
- return {
72
- text: row.origRow[field.idx],
73
- rowIdx: row.idx
74
- };
75
- });
76
- suggest(suggestions);
77
- }
78
- },
79
- renderItem: (item, search) => {
80
- search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
81
- const re = new RegExp("(" + search.split(" ").join("|") + ")", "gi");
82
- return '<div class="autocomplete-suggestion" data-val="' + item.text + '" data-row-idx="' + item.rowIdx + '">' + item.text.replace(re, "<b>$1</b>") + "</div>";
83
- },
84
- onSelect: (e, term, item) => {
85
- const rowIdx = +item.getAttribute("data-row-idx");
86
- const row = context.autoCompleteTextData()[rowIdx];
87
- context.click(context.rowToObj(row.origRow), context.valueColumn(), true);
88
- }
89
- });
90
- }
91
- }
92
-
93
- exit(domNode, element) {
94
- if (this._autoComplete) {
95
- this._autoComplete.destroy();
96
- }
97
- this._span.remove();
98
- super.exit(domNode, element);
99
- }
100
-
101
- click(row, column, selected) {
102
- }
103
- }
104
- AutoCompleteText.prototype._class += " other_AutoCompleteText";
105
-
106
- export interface AutoCompleteText {
107
- label(): string;
108
- label(_: string): this;
109
- label_exists(): boolean;
110
- textboxWidth(): number;
111
- textboxWidth(_: number): this;
112
- textboxWidth_exists(): boolean;
113
- placeholder(): string;
114
- placeholder(_: string): this;
115
- placeholder_exists(): boolean;
116
- valueColumn(): string;
117
- valueColumn(_: string): this;
118
- valueColumn_exists(): boolean;
119
- textColumn(): string;
120
- textColumn(_: string): this;
121
- textColumn_exists(): boolean;
122
- minCharsText(): number;
123
- minCharsText(_: number): this;
124
- minCharsText_exists(): boolean;
125
- }
126
-
127
- AutoCompleteText.prototype.publish("label", "Label: ", "string", "Label for AutoCompleteText");
128
- AutoCompleteText.prototype.publish("textboxWidth", null, "number", "width of textbox", null, { optional: true });
129
- AutoCompleteText.prototype.publish("placeholder", "Search...", "string", "Placeholder for AutoCompleteText");
130
- AutoCompleteText.prototype.publish("valueColumn", null, "set", "Select column for autocomplete", function () { return this.columns(); }, { optional: true });
131
- AutoCompleteText.prototype.publish("textColumn", null, "set", "Select value(s)", function () { return this.columns(); }, { optional: true });
132
- AutoCompleteText.prototype.publish("minCharsText", 1, "number", "Size of multiAutoCompleteText box");
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+ import AutoComplete from "javascript-autocomplete";
3
+
4
+ import "../src/AutoCompleteText.css";
5
+
6
+ export class AutoCompleteText extends HTMLWidget {
7
+ _span;
8
+ _prompt;
9
+ _input;
10
+ _prevMinCharsText;
11
+ _autoComplete;
12
+
13
+ constructor() {
14
+ super();
15
+ this._tag = "div";
16
+ }
17
+
18
+ autoCompleteTextData() {
19
+ if (this.data().length === 0) return [];
20
+ const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
21
+ return view.entries().map(function (row, idx) {
22
+ return {
23
+ idx,
24
+ text: row.key,
25
+ value: row.values.length ? row.values[0].key : "",
26
+ origRow: row.values.length && row.values[0].value.length ? row.values[0].value[0] : []
27
+ };
28
+ }, this);
29
+ }
30
+
31
+ enter(domNode, element) {
32
+ super.enter(domNode, element);
33
+ this._span = element.append("span");
34
+ this._prompt = this._span.append("label")
35
+ .attr("for", this.id() + "_input")
36
+ ;
37
+ this._input = this._span.append("input")
38
+ .attr("id", this.id() + "_input")
39
+ .attr("name", this.id() + "_input_name")
40
+ .attr("type", "text")
41
+ .attr("placeholder", this.placeholder())
42
+ ;
43
+ }
44
+
45
+ update(domNode, element) {
46
+ super.update(domNode, element);
47
+
48
+ this._prompt.text(this.label());
49
+ this._input.style("width", this.textboxWidth_exists() ? this.textboxWidth() + "px" : null);
50
+
51
+ if (this._prevMinCharsText !== this.minCharsText()) {
52
+ this._prevMinCharsText = this.minCharsText();
53
+
54
+ if (this._autoComplete) {
55
+ this._autoComplete.destroy();
56
+ }
57
+ const context = this;
58
+ this._autoComplete = new AutoComplete({
59
+ selector: "#" + this.id() + "_input",
60
+ minChars: this.minCharsText(),
61
+ delay: 150,
62
+ offsetLeft: 0,
63
+ offsetTop: 1,
64
+ source: (term, suggest) => {
65
+ const field = context._db.fieldByLabel(context.textColumn());
66
+ if (field) {
67
+ term = term.toLowerCase();
68
+ const suggestions = context.autoCompleteTextData().filter(function (row) {
69
+ return row.origRow[field.idx].toLowerCase().indexOf(term) >= 0;
70
+ }).map(function (row) {
71
+ return {
72
+ text: row.origRow[field.idx],
73
+ rowIdx: row.idx
74
+ };
75
+ });
76
+ suggest(suggestions);
77
+ }
78
+ },
79
+ renderItem: (item, search) => {
80
+ search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
81
+ const re = new RegExp("(" + search.split(" ").join("|") + ")", "gi");
82
+ return '<div class="autocomplete-suggestion" data-val="' + item.text + '" data-row-idx="' + item.rowIdx + '">' + item.text.replace(re, "<b>$1</b>") + "</div>";
83
+ },
84
+ onSelect: (e, term, item) => {
85
+ const rowIdx = +item.getAttribute("data-row-idx");
86
+ const row = context.autoCompleteTextData()[rowIdx];
87
+ context.click(context.rowToObj(row.origRow), context.valueColumn(), true);
88
+ }
89
+ });
90
+ }
91
+ }
92
+
93
+ exit(domNode, element) {
94
+ if (this._autoComplete) {
95
+ this._autoComplete.destroy();
96
+ }
97
+ this._span.remove();
98
+ super.exit(domNode, element);
99
+ }
100
+
101
+ click(row, column, selected) {
102
+ }
103
+ }
104
+ AutoCompleteText.prototype._class += " other_AutoCompleteText";
105
+
106
+ export interface AutoCompleteText {
107
+ label(): string;
108
+ label(_: string): this;
109
+ label_exists(): boolean;
110
+ textboxWidth(): number;
111
+ textboxWidth(_: number): this;
112
+ textboxWidth_exists(): boolean;
113
+ placeholder(): string;
114
+ placeholder(_: string): this;
115
+ placeholder_exists(): boolean;
116
+ valueColumn(): string;
117
+ valueColumn(_: string): this;
118
+ valueColumn_exists(): boolean;
119
+ textColumn(): string;
120
+ textColumn(_: string): this;
121
+ textColumn_exists(): boolean;
122
+ minCharsText(): number;
123
+ minCharsText(_: number): this;
124
+ minCharsText_exists(): boolean;
125
+ }
126
+
127
+ AutoCompleteText.prototype.publish("label", "Label: ", "string", "Label for AutoCompleteText");
128
+ AutoCompleteText.prototype.publish("textboxWidth", null, "number", "width of textbox", null, { optional: true });
129
+ AutoCompleteText.prototype.publish("placeholder", "Search...", "string", "Placeholder for AutoCompleteText");
130
+ AutoCompleteText.prototype.publish("valueColumn", null, "set", "Select column for autocomplete", function () { return this.columns(); }, { optional: true });
131
+ AutoCompleteText.prototype.publish("textColumn", null, "set", "Select value(s)", function () { return this.columns(); }, { optional: true });
132
+ AutoCompleteText.prototype.publish("minCharsText", 1, "number", "Size of multiAutoCompleteText box");
@@ -1,26 +1,26 @@
1
- .other_CalendarHeatMap {
2
- shape-rendering: crispEdges;
3
- }
4
-
5
- .other_CalendarHeatMap .day {
6
- fill: #fff;
7
- stroke: #ccc;
8
- }
9
-
10
- .other_CalendarHeatMap .day.selected {
11
- stroke: red;
12
- }
13
-
14
- .other_CalendarHeatMap .day.over {
15
- stroke: orange;
16
- }
17
-
18
- .other_CalendarHeatMap .day.selected.over {
19
- stroke: red;
20
- }
21
-
22
- .other_CalendarHeatMap .month {
23
- fill: none;
24
- stroke: #000;
25
- stroke-width: 2px;
1
+ .other_CalendarHeatMap {
2
+ shape-rendering: crispEdges;
3
+ }
4
+
5
+ .other_CalendarHeatMap .day {
6
+ fill: #fff;
7
+ stroke: #ccc;
8
+ }
9
+
10
+ .other_CalendarHeatMap .day.selected {
11
+ stroke: red;
12
+ }
13
+
14
+ .other_CalendarHeatMap .day.over {
15
+ stroke: orange;
16
+ }
17
+
18
+ .other_CalendarHeatMap .day.selected.over {
19
+ stroke: red;
20
+ }
21
+
22
+ .other_CalendarHeatMap .month {
23
+ fill: none;
24
+ stroke: #000;
25
+ stroke-width: 2px;
26
26
  }