@holoviz/panel 1.0.0-b.3 → 1.0.0-b.4
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/dist/bundled/bootstraptemplate/bootstrap.css +1 -0
- package/dist/bundled/notificationarea/panel/1.0.0-b.4/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-b.4/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
- package/dist/bundled/panel/1.0.0-b.4/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
- package/dist/bundled/panel/1.0.0-b.4/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.0.0-b.4/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/bundled/plotlyplot/panel/1.0.0-b.4/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/lib/models/index.d.ts +1 -0
- package/dist/lib/models/index.js +1 -0
- package/dist/lib/models/index.js.map +1 -1
- package/dist/lib/models/vizzu.d.ts +43 -0
- package/dist/lib/models/vizzu.js +161 -0
- package/dist/lib/models/vizzu.js.map +1 -0
- package/dist/panel.js +171 -3
- package/dist/panel.js.map +1 -1
- package/dist/panel.json +1 -1
- package/dist/panel.min.js +4 -3
- package/dist/wheels/{panel-1.0.0b3-py3-none-any.whl → panel-1.0.0b4-py3-none-any.whl} +0 -0
- package/package.json +1 -1
- package/dist/bundled/notificationarea/panel/1.0.0-b.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/panel/1.0.0-b.3/dist/bundled/bootstrap5/css/bootstrap.min.css +0 -2
- package/dist/bundled/panel/1.0.0-b.3/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +0 -2
- package/dist/bundled/panel/1.0.0-b.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/panel/1.0.0-b.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
- package/dist/bundled/plotlyplot/panel/1.0.0-b.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
package/dist/lib/models/index.js
CHANGED
|
@@ -31,5 +31,6 @@ export { TrendIndicator } from "./trend";
|
|
|
31
31
|
export { VegaPlot } from "./vega";
|
|
32
32
|
export { Video } from "./video";
|
|
33
33
|
export { VideoStream } from "./videostream";
|
|
34
|
+
export { VizzuChart } from "./vizzu";
|
|
34
35
|
export * from "./vtk";
|
|
35
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AACzC,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAA;AACnC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACnC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO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AAA;AAC7B,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAA;AAClC,cAAc,OAAO,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as p from "@bokehjs/core/properties";
|
|
2
|
+
import { ColumnDataSource } from "@bokehjs/models/sources/column_data_source";
|
|
3
|
+
import { ModelEvent } from "@bokehjs/core/bokeh_events";
|
|
4
|
+
import { Attrs } from "@bokehjs/core/types";
|
|
5
|
+
import { HTMLBox, HTMLBoxView } from "./layout";
|
|
6
|
+
export declare class VizzuEvent extends ModelEvent {
|
|
7
|
+
readonly data: any;
|
|
8
|
+
event_name: string;
|
|
9
|
+
publish: boolean;
|
|
10
|
+
constructor(data: any);
|
|
11
|
+
protected get event_values(): Attrs;
|
|
12
|
+
}
|
|
13
|
+
export declare class VizzuChartView extends HTMLBoxView {
|
|
14
|
+
container: HTMLDivElement;
|
|
15
|
+
model: VizzuChart;
|
|
16
|
+
update: string[];
|
|
17
|
+
vizzu_view: any;
|
|
18
|
+
_animating: boolean;
|
|
19
|
+
connect_signals(): void;
|
|
20
|
+
get valid_config(): boolean;
|
|
21
|
+
private config;
|
|
22
|
+
private data;
|
|
23
|
+
render(): void;
|
|
24
|
+
remove(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace VizzuChart {
|
|
27
|
+
type Attrs = p.AttrsOf<Props>;
|
|
28
|
+
type Props = HTMLBox.Props & {
|
|
29
|
+
animation: p.Property<any>;
|
|
30
|
+
config: p.Property<any>;
|
|
31
|
+
columns: p.Property<any>;
|
|
32
|
+
source: p.Property<ColumnDataSource>;
|
|
33
|
+
duration: p.Property<number>;
|
|
34
|
+
style: p.Property<any>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface VizzuChart extends VizzuChart.Attrs {
|
|
38
|
+
}
|
|
39
|
+
export declare class VizzuChart extends HTMLBox {
|
|
40
|
+
properties: VizzuChart.Props;
|
|
41
|
+
constructor(attrs?: Partial<VizzuChart.Attrs>);
|
|
42
|
+
static __module__: string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { div } from "@bokehjs/core/dom";
|
|
3
|
+
import { isArray, isObject } from "@bokehjs/core/util/types";
|
|
4
|
+
import { ColumnDataSource } from "@bokehjs/models/sources/column_data_source";
|
|
5
|
+
import { ModelEvent } from "@bokehjs/core/bokeh_events";
|
|
6
|
+
import { debounce } from "debounce";
|
|
7
|
+
import { HTMLBox, HTMLBoxView } from "./layout";
|
|
8
|
+
export class VizzuEvent extends ModelEvent {
|
|
9
|
+
constructor(data) {
|
|
10
|
+
super();
|
|
11
|
+
this.data = data;
|
|
12
|
+
this.event_name = "vizzu_event";
|
|
13
|
+
this.publish = true;
|
|
14
|
+
}
|
|
15
|
+
get event_values() {
|
|
16
|
+
return { model: this.origin, data: this.data };
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
VizzuEvent.__name__ = "VizzuEvent";
|
|
20
|
+
const VECTORIZED_PROPERTIES = ['x', 'y', 'color', 'label', 'lightness', 'size', 'splittedBy', 'dividedBy'];
|
|
21
|
+
export class VizzuChartView extends HTMLBoxView {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.update = [];
|
|
25
|
+
this._animating = false;
|
|
26
|
+
}
|
|
27
|
+
connect_signals() {
|
|
28
|
+
super.connect_signals();
|
|
29
|
+
const update = debounce(() => {
|
|
30
|
+
if (!this.valid_config) {
|
|
31
|
+
console.warn('Vizzu config not valid given current data.');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
else if (!this.update.length || this._animating)
|
|
35
|
+
return;
|
|
36
|
+
else {
|
|
37
|
+
let change = {};
|
|
38
|
+
for (const prop of this.update) {
|
|
39
|
+
if (prop === 'config')
|
|
40
|
+
change = { ...change, config: this.config() };
|
|
41
|
+
else if (prop === 'data')
|
|
42
|
+
change = { ...change, data: this.data() };
|
|
43
|
+
else
|
|
44
|
+
change = { ...change, style: this.model.style };
|
|
45
|
+
}
|
|
46
|
+
if (this.update.includes('data') && this.update.length === 1) {
|
|
47
|
+
this.render();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this._animating = true;
|
|
51
|
+
this.vizzu_view.animate(change, this.model.duration + 'ms').then(() => {
|
|
52
|
+
this._animating = false;
|
|
53
|
+
if (this.update.length)
|
|
54
|
+
update();
|
|
55
|
+
});
|
|
56
|
+
this.update = [];
|
|
57
|
+
}
|
|
58
|
+
}, 20);
|
|
59
|
+
const update_prop = (prop) => {
|
|
60
|
+
if (!this.update.includes(prop))
|
|
61
|
+
this.update.push(prop);
|
|
62
|
+
update();
|
|
63
|
+
};
|
|
64
|
+
this.connect(this.model.properties.config.change, () => update_prop('config'));
|
|
65
|
+
this.connect(this.model.source.properties.data.change, () => update_prop('data'));
|
|
66
|
+
this.connect(this.model.source.streaming, () => update_prop('data'));
|
|
67
|
+
this.connect(this.model.source.patching, () => update_prop('data'));
|
|
68
|
+
this.connect(this.model.properties.style.change, () => update_prop('style'));
|
|
69
|
+
}
|
|
70
|
+
get valid_config() {
|
|
71
|
+
const columns = this.model.source.columns();
|
|
72
|
+
if ('channels' in this.model.config) {
|
|
73
|
+
for (const col of Object.values(this.model.config.channels)) {
|
|
74
|
+
if (isArray(col)) {
|
|
75
|
+
for (const c of col) {
|
|
76
|
+
if (col != null && !columns.includes(c))
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else if (isObject(col)) {
|
|
81
|
+
for (const prop of Object.keys(col)) {
|
|
82
|
+
for (const c of col[prop]) {
|
|
83
|
+
if (col != null && !columns.includes(c))
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else if (col != null && !columns.includes(col))
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (const prop of VECTORIZED_PROPERTIES) {
|
|
94
|
+
if (prop in this.model.config && !columns.includes(this.model.config[prop]))
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
config() {
|
|
101
|
+
let config = { ...this.model.config };
|
|
102
|
+
if ('channels' in config)
|
|
103
|
+
config['channels'] = { ...config.channels };
|
|
104
|
+
if (config.preset != undefined)
|
|
105
|
+
config = window.Vizzu.presets[config.preset](config);
|
|
106
|
+
return config;
|
|
107
|
+
}
|
|
108
|
+
data() {
|
|
109
|
+
const series = [];
|
|
110
|
+
for (const column of this.model.columns) {
|
|
111
|
+
let array = [...this.model.source.get_array(column.name)];
|
|
112
|
+
if (column.type === 'datetime' || column.type == 'date')
|
|
113
|
+
column.type = 'measure';
|
|
114
|
+
if (column.type === 'dimension')
|
|
115
|
+
array = array.map(String);
|
|
116
|
+
series.push({ ...column, values: array });
|
|
117
|
+
}
|
|
118
|
+
return { series };
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
super.render();
|
|
122
|
+
this.container = div({ 'style': 'display: contents;' });
|
|
123
|
+
this.shadow_el.append(this.container);
|
|
124
|
+
const state = { config: this.config(), data: this.data(), style: this.model.style };
|
|
125
|
+
this.vizzu_view = new window.Vizzu(this.container, state);
|
|
126
|
+
this._animating = true;
|
|
127
|
+
this.vizzu_view.initializing.then((chart) => {
|
|
128
|
+
chart.on('click', (event) => {
|
|
129
|
+
this.model.trigger_event(new VizzuEvent(event.data));
|
|
130
|
+
});
|
|
131
|
+
this._animating = false;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
remove() {
|
|
135
|
+
if (this.vizzu_view) {
|
|
136
|
+
this.vizzu_view.detach();
|
|
137
|
+
}
|
|
138
|
+
super.remove();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
VizzuChartView.__name__ = "VizzuChartView";
|
|
142
|
+
export class VizzuChart extends HTMLBox {
|
|
143
|
+
constructor(attrs) {
|
|
144
|
+
super(attrs);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
_a = VizzuChart;
|
|
148
|
+
VizzuChart.__name__ = "VizzuChart";
|
|
149
|
+
VizzuChart.__module__ = "panel.models.vizzu";
|
|
150
|
+
(() => {
|
|
151
|
+
_a.prototype.default_view = VizzuChartView;
|
|
152
|
+
_a.define(({ Any, Array, Number, Ref }) => ({
|
|
153
|
+
animation: [Any, {}],
|
|
154
|
+
config: [Any, {}],
|
|
155
|
+
columns: [Array(Any), []],
|
|
156
|
+
source: [Ref(ColumnDataSource),],
|
|
157
|
+
duration: [Number, 500],
|
|
158
|
+
style: [Any, {}],
|
|
159
|
+
}));
|
|
160
|
+
})();
|
|
161
|
+
//# sourceMappingURL=vizzu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vizzu.js","sourceRoot":"","sources":["../../../models/vizzu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,mBAAmB,CAAA;AAErC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAA;AAGrD,OAAO,EAAC,QAAQ,EAAC,MAAO,UAAU,CAAA;AAElC,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,MAAM,UAAU,CAAA;AAG7C,MAAM,OAAO,UAAW,SAAQ,UAAU;IAIxC,YAAqB,IAAS;QAC5B,KAAK,EAAE,CAAA;QADY,SAAI,GAAJ,IAAI,CAAK;QAH9B,eAAU,GAAW,aAAa,CAAA;QAClC,YAAO,GAAY,IAAI,CAAA;IAIvB,CAAC;IAED,IAAc,YAAY;QACxB,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAA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CAAC,EAAe,EAAE,CAAE;QAC5C,MAAM,EAAO,CAAE,GAAG,CAAC,gBAAgB,CAAC,EAAQ;QAC5C,QAAQ,EAAK,CAAE,MAAM,EAAkB,GAAG,CAAE;QAC5C,KAAK,EAAQ,CAAE,GAAG,EAAsB,EAAE,CAAE;KAC7C,CAAC,CAAC,CAAA;AACL,CAAC,GAAA,CAAA"}
|
package/dist/panel.js
CHANGED
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"4e90918c0a": /* index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
45
45
|
__esModule();
|
|
46
46
|
const tslib_1 = require("tslib");
|
|
47
|
-
const Panel = tslib_1.__importStar(require("
|
|
47
|
+
const Panel = tslib_1.__importStar(require("eb3f77caeb") /* ./models */);
|
|
48
48
|
exports.Panel = Panel;
|
|
49
49
|
const base_1 = require("@bokehjs/base");
|
|
50
50
|
(0, base_1.register_models)(Panel);
|
|
51
51
|
},
|
|
52
|
-
"
|
|
52
|
+
"eb3f77caeb": /* models/index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
53
53
|
__esModule();
|
|
54
54
|
const tslib_1 = require("tslib");
|
|
55
55
|
var ace_1 = require("361114b33f") /* ./ace */;
|
|
@@ -118,6 +118,8 @@
|
|
|
118
118
|
__esExport("Video", video_1.Video);
|
|
119
119
|
var videostream_1 = require("2dfabe6882") /* ./videostream */;
|
|
120
120
|
__esExport("VideoStream", videostream_1.VideoStream);
|
|
121
|
+
var vizzu_1 = require("a6dbadf829") /* ./vizzu */;
|
|
122
|
+
__esExport("VizzuChart", vizzu_1.VizzuChart);
|
|
121
123
|
tslib_1.__exportStar(require("c51f25e2a7") /* ./vtk */, exports);
|
|
122
124
|
},
|
|
123
125
|
"361114b33f": /* models/ace.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
@@ -10399,6 +10401,172 @@
|
|
|
10399
10401
|
});
|
|
10400
10402
|
})();
|
|
10401
10403
|
},
|
|
10404
|
+
"a6dbadf829": /* models/vizzu.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
10405
|
+
__esModule();
|
|
10406
|
+
var _a;
|
|
10407
|
+
const dom_1 = require("@bokehjs/core/dom");
|
|
10408
|
+
const types_1 = require("@bokehjs/core/util/types");
|
|
10409
|
+
const column_data_source_1 = require("@bokehjs/models/sources/column_data_source");
|
|
10410
|
+
const bokeh_events_1 = require("@bokehjs/core/bokeh_events");
|
|
10411
|
+
const debounce_1 = require("99a25e6992") /* debounce */;
|
|
10412
|
+
const layout_1 = require("df5b3692ab") /* ./layout */;
|
|
10413
|
+
class VizzuEvent extends bokeh_events_1.ModelEvent {
|
|
10414
|
+
constructor(data) {
|
|
10415
|
+
super();
|
|
10416
|
+
this.data = data;
|
|
10417
|
+
this.event_name = "vizzu_event";
|
|
10418
|
+
this.publish = true;
|
|
10419
|
+
}
|
|
10420
|
+
get event_values() {
|
|
10421
|
+
return { model: this.origin, data: this.data };
|
|
10422
|
+
}
|
|
10423
|
+
}
|
|
10424
|
+
exports.VizzuEvent = VizzuEvent;
|
|
10425
|
+
VizzuEvent.__name__ = "VizzuEvent";
|
|
10426
|
+
const VECTORIZED_PROPERTIES = ['x', 'y', 'color', 'label', 'lightness', 'size', 'splittedBy', 'dividedBy'];
|
|
10427
|
+
class VizzuChartView extends layout_1.HTMLBoxView {
|
|
10428
|
+
constructor() {
|
|
10429
|
+
super(...arguments);
|
|
10430
|
+
this.update = [];
|
|
10431
|
+
this._animating = false;
|
|
10432
|
+
}
|
|
10433
|
+
connect_signals() {
|
|
10434
|
+
super.connect_signals();
|
|
10435
|
+
const update = (0, debounce_1.debounce)(() => {
|
|
10436
|
+
if (!this.valid_config) {
|
|
10437
|
+
console.warn('Vizzu config not valid given current data.');
|
|
10438
|
+
return;
|
|
10439
|
+
}
|
|
10440
|
+
else if (!this.update.length || this._animating)
|
|
10441
|
+
return;
|
|
10442
|
+
else {
|
|
10443
|
+
let change = {};
|
|
10444
|
+
for (const prop of this.update) {
|
|
10445
|
+
if (prop === 'config')
|
|
10446
|
+
change = Object.assign(Object.assign({}, change), { config: this.config() });
|
|
10447
|
+
else if (prop === 'data')
|
|
10448
|
+
change = Object.assign(Object.assign({}, change), { data: this.data() });
|
|
10449
|
+
else
|
|
10450
|
+
change = Object.assign(Object.assign({}, change), { style: this.model.style });
|
|
10451
|
+
}
|
|
10452
|
+
if (this.update.includes('data') && this.update.length === 1) {
|
|
10453
|
+
this.render();
|
|
10454
|
+
return;
|
|
10455
|
+
}
|
|
10456
|
+
this._animating = true;
|
|
10457
|
+
this.vizzu_view.animate(change, this.model.duration + 'ms').then(() => {
|
|
10458
|
+
this._animating = false;
|
|
10459
|
+
if (this.update.length)
|
|
10460
|
+
update();
|
|
10461
|
+
});
|
|
10462
|
+
this.update = [];
|
|
10463
|
+
}
|
|
10464
|
+
}, 20);
|
|
10465
|
+
const update_prop = (prop) => {
|
|
10466
|
+
if (!this.update.includes(prop))
|
|
10467
|
+
this.update.push(prop);
|
|
10468
|
+
update();
|
|
10469
|
+
};
|
|
10470
|
+
this.connect(this.model.properties.config.change, () => update_prop('config'));
|
|
10471
|
+
this.connect(this.model.source.properties.data.change, () => update_prop('data'));
|
|
10472
|
+
this.connect(this.model.source.streaming, () => update_prop('data'));
|
|
10473
|
+
this.connect(this.model.source.patching, () => update_prop('data'));
|
|
10474
|
+
this.connect(this.model.properties.style.change, () => update_prop('style'));
|
|
10475
|
+
}
|
|
10476
|
+
get valid_config() {
|
|
10477
|
+
const columns = this.model.source.columns();
|
|
10478
|
+
if ('channels' in this.model.config) {
|
|
10479
|
+
for (const col of Object.values(this.model.config.channels)) {
|
|
10480
|
+
if ((0, types_1.isArray)(col)) {
|
|
10481
|
+
for (const c of col) {
|
|
10482
|
+
if (col != null && !columns.includes(c))
|
|
10483
|
+
return false;
|
|
10484
|
+
}
|
|
10485
|
+
}
|
|
10486
|
+
else if ((0, types_1.isObject)(col)) {
|
|
10487
|
+
for (const prop of Object.keys(col)) {
|
|
10488
|
+
for (const c of col[prop]) {
|
|
10489
|
+
if (col != null && !columns.includes(c))
|
|
10490
|
+
return false;
|
|
10491
|
+
}
|
|
10492
|
+
}
|
|
10493
|
+
}
|
|
10494
|
+
else if (col != null && !columns.includes(col))
|
|
10495
|
+
return false;
|
|
10496
|
+
}
|
|
10497
|
+
}
|
|
10498
|
+
else {
|
|
10499
|
+
for (const prop of VECTORIZED_PROPERTIES) {
|
|
10500
|
+
if (prop in this.model.config && !columns.includes(this.model.config[prop]))
|
|
10501
|
+
return false;
|
|
10502
|
+
}
|
|
10503
|
+
}
|
|
10504
|
+
return true;
|
|
10505
|
+
}
|
|
10506
|
+
config() {
|
|
10507
|
+
let config = Object.assign({}, this.model.config);
|
|
10508
|
+
if ('channels' in config)
|
|
10509
|
+
config['channels'] = Object.assign({}, config.channels);
|
|
10510
|
+
if (config.preset != undefined)
|
|
10511
|
+
config = window.Vizzu.presets[config.preset](config);
|
|
10512
|
+
return config;
|
|
10513
|
+
}
|
|
10514
|
+
data() {
|
|
10515
|
+
const series = [];
|
|
10516
|
+
for (const column of this.model.columns) {
|
|
10517
|
+
let array = [...this.model.source.get_array(column.name)];
|
|
10518
|
+
if (column.type === 'datetime' || column.type == 'date')
|
|
10519
|
+
column.type = 'measure';
|
|
10520
|
+
if (column.type === 'dimension')
|
|
10521
|
+
array = array.map(String);
|
|
10522
|
+
series.push(Object.assign(Object.assign({}, column), { values: array }));
|
|
10523
|
+
}
|
|
10524
|
+
return { series };
|
|
10525
|
+
}
|
|
10526
|
+
render() {
|
|
10527
|
+
super.render();
|
|
10528
|
+
this.container = (0, dom_1.div)({ 'style': 'display: contents;' });
|
|
10529
|
+
this.shadow_el.append(this.container);
|
|
10530
|
+
const state = { config: this.config(), data: this.data(), style: this.model.style };
|
|
10531
|
+
this.vizzu_view = new window.Vizzu(this.container, state);
|
|
10532
|
+
this._animating = true;
|
|
10533
|
+
this.vizzu_view.initializing.then((chart) => {
|
|
10534
|
+
chart.on('click', (event) => {
|
|
10535
|
+
this.model.trigger_event(new VizzuEvent(event.data));
|
|
10536
|
+
});
|
|
10537
|
+
this._animating = false;
|
|
10538
|
+
});
|
|
10539
|
+
}
|
|
10540
|
+
remove() {
|
|
10541
|
+
if (this.vizzu_view) {
|
|
10542
|
+
this.vizzu_view.detach();
|
|
10543
|
+
}
|
|
10544
|
+
super.remove();
|
|
10545
|
+
}
|
|
10546
|
+
}
|
|
10547
|
+
exports.VizzuChartView = VizzuChartView;
|
|
10548
|
+
VizzuChartView.__name__ = "VizzuChartView";
|
|
10549
|
+
class VizzuChart extends layout_1.HTMLBox {
|
|
10550
|
+
constructor(attrs) {
|
|
10551
|
+
super(attrs);
|
|
10552
|
+
}
|
|
10553
|
+
}
|
|
10554
|
+
exports.VizzuChart = VizzuChart;
|
|
10555
|
+
_a = VizzuChart;
|
|
10556
|
+
VizzuChart.__name__ = "VizzuChart";
|
|
10557
|
+
VizzuChart.__module__ = "panel.models.vizzu";
|
|
10558
|
+
(() => {
|
|
10559
|
+
_a.prototype.default_view = VizzuChartView;
|
|
10560
|
+
_a.define(({ Any, Array, Number, Ref }) => ({
|
|
10561
|
+
animation: [Any, {}],
|
|
10562
|
+
config: [Any, {}],
|
|
10563
|
+
columns: [Array(Any), []],
|
|
10564
|
+
source: [Ref(column_data_source_1.ColumnDataSource),],
|
|
10565
|
+
duration: [Number, 500],
|
|
10566
|
+
style: [Any, {}],
|
|
10567
|
+
}));
|
|
10568
|
+
})();
|
|
10569
|
+
},
|
|
10402
10570
|
"c51f25e2a7": /* models/vtk/index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
10403
10571
|
__esModule();
|
|
10404
10572
|
var vtkjs_1 = require("028b3b9741") /* ./vtkjs */;
|
|
@@ -18592,5 +18760,5 @@
|
|
|
18592
18760
|
}
|
|
18593
18761
|
exports.initialize_fullscreen_render = initialize_fullscreen_render;
|
|
18594
18762
|
},
|
|
18595
|
-
}, "4e90918c0a", {"index":"4e90918c0a","models/index":"
|
|
18763
|
+
}, "4e90918c0a", {"index":"4e90918c0a","models/index":"eb3f77caeb","models/ace":"361114b33f","models/layout":"df5b3692ab","models/audio":"d8d3afec63","models/card":"c1f1b4086d","models/comm_manager":"75980dde2d","models/customselect":"e258e515be","models/tabulator":"e50776e0d1","models/data":"fd9108e30e","models/datetime_picker":"4f73d5ebca","models/deckgl":"5b67cd6d35","models/tooltips":"6e04fbe567","models/echarts":"de43a95fca","models/event-to-object":"490942d778","models/html":"a8d43c9bf6","models/ipywidget":"b64f9048d8","models/json":"66f63e3c42","models/jsoneditor":"3c56a75fcf","models/file_download":"1a94c83be4","models/katex":"173673276e","models/location":"a85ed38ee9","models/mathjax":"9f7d610997","models/pdf":"46cccf2270","models/perspective":"ae1bae91c1","models/player":"bd5015f776","models/plotly":"76fb42fdbf","models/util":"990b5dd5c7","models/progress":"e6caa5bc95","models/quill":"98652399b1","models/reactive_html":"d4d0333051","models/singleselect":"3413aa6637","models/speech_to_text":"c9d8bd05e6","models/state":"c67a910ee4","models/terminal":"e4ca4f1ca9","models/text_to_speech":"a44f0bd49f","models/trend":"c2c4524e04","models/vega":"2418976f60","models/video":"222009eb8a","models/videostream":"2dfabe6882","models/vizzu":"a6dbadf829","models/vtk/index":"c51f25e2a7","models/vtk/vtkjs":"028b3b9741","models/vtk/vtklayout":"74d00b139f","models/vtk/util":"993f3118b2","models/vtk/vtkcolorbar":"c010237f8b","models/vtk/vtkaxes":"764861e940","models/vtk/vtkvolume":"2b0ad3ca0b","models/vtk/vtksynchronized":"52d292c3ba","models/vtk/panel_fullscreen_renwin_sync":"877619fe71"}, {});});
|
|
18596
18764
|
//# sourceMappingURL=panel.js.map
|