@hpcc-js/other 3.4.7 → 3.4.10

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.4.7",
3
+ "version": "3.4.10",
4
4
  "description": "hpcc-js - Viz Other",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
@@ -37,12 +37,12 @@
37
37
  "update-major": "npx --yes npm-check-updates -u"
38
38
  },
39
39
  "dependencies": {
40
- "@hpcc-js/api": "^3.4.6",
41
- "@hpcc-js/common": "^3.6.2",
42
- "@hpcc-js/layout": "^3.5.1"
40
+ "@hpcc-js/api": "^3.4.9",
41
+ "@hpcc-js/common": "^3.6.5",
42
+ "@hpcc-js/layout": "^3.5.4"
43
43
  },
44
44
  "devDependencies": {
45
- "@hpcc-js/esbuild-plugins": "^1.8.1",
45
+ "@hpcc-js/esbuild-plugins": "^1.8.3",
46
46
  "d3-array": "^1",
47
47
  "d3-collection": "^1",
48
48
  "d3-format": "^1",
@@ -67,5 +67,5 @@
67
67
  "url": "https://github.com/hpcc-systems/Visualization/issues"
68
68
  },
69
69
  "homepage": "https://github.com/hpcc-systems/Visualization",
70
- "gitHead": "cdd52de0cb8b157acefb4cea23895268d8127570"
70
+ "gitHead": "34c404f172efc43a9caf59e8e463d1f07d469578"
71
71
  }
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,21 +1,21 @@
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; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
15
- /* core styles should not be changed */
16
- position: absolute; display: none; z-index: 9999; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
17
- }
18
- .autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
19
- .autocomplete-suggestion b { font-weight: normal; color: #1f8dd6; }
20
- .autocomplete-suggestion.selected { background: #f0f0f0; }
21
-
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; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
15
+ /* core styles should not be changed */
16
+ position: absolute; display: none; z-index: 9999; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
17
+ }
18
+ .autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
19
+ .autocomplete-suggestion b { font-weight: normal; color: #1f8dd6; }
20
+ .autocomplete-suggestion.selected { background: #f0f0f0; }
21
+
@@ -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;
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;
26
+ }