Skip to content

Commit d1cf2a5

Browse files
authored
Merge pull request #1471 from finos/vieux-config
Refactoring
2 parents 2f77af2 + 745bcc9 commit d1cf2a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1865
-669
lines changed

packages/perspective-viewer-d3fc/src/js/plugin/plugin.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ export function register(...plugins) {
9191
chart.plugin.max_columns = x;
9292
}
9393

94-
async draw(view, task, end_col, end_row) {
95-
await this.update(view, task, end_col, end_row, true);
94+
async draw(view, end_col, end_row) {
95+
await this.update(view, end_col, end_row, true);
9696
}
9797

98-
async update(view, task, end_col, end_row, clear = false) {
98+
async update(view, end_col, end_row, clear = false) {
9999
if (!this.isConnected) {
100100
return;
101101
}
@@ -115,10 +115,6 @@ export function register(...plugins) {
115115
}
116116
metadata = await Promise.all([viewer._table.schema(false), view.expression_schema(false), view.schema(false), jsonp, view.get_config()]);
117117

118-
if (task.cancelled) {
119-
return;
120-
}
121-
122118
let [table_schema, expression_schema, view_schema, json, config] = metadata;
123119

124120
/**

packages/perspective-viewer/src/html/viewer.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
</div>
2121

22-
<div slot="top_panel" id='top_panel'>
22+
<div slot="top_panel" id='top_panel' style="visibility: hidden">
2323
<div class="rrow">
2424
<div id="row_pivots">
2525
<div class="psp-text-field">
@@ -56,13 +56,7 @@
5656
</div>
5757

5858
<div slot="main_panel" id="pivot_chart_container">
59-
<div class="plugin_information plugin_information--warning hidden" id="plugin_information--size">
60-
<span class="plugin_information__text" id="plugin_information_count">Estimated rendering</span>
61-
<span class="plugin_information__actions">
62-
<span class="plugin_information__action">Render all points</span>
63-
</span>
64-
</div>
65-
<div id="pivot_chart">
59+
<div id="pivot_chart">
6660
<slot></slot>
6761
</div>
6862
</div>

packages/perspective-viewer/src/js/viewer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,15 @@ class PerspectiveViewer extends ActionElement {
408408
*/
409409
set plugin(v) {
410410
if (v === "null" || v === null || v === undefined) {
411-
(this._vieux._instance || this._vieux).set_plugin_default();
411+
(this._vieux._instance || this._vieux).set_plugin();
412412
return;
413413
}
414414

415415
if (this.hasAttribute("plugin")) {
416416
let plugin = this.getAttribute("plugin");
417417
(this._vieux._instance || this._vieux).set_plugin(plugin);
418418
} else {
419-
(this._vieux._instance || this._vieux).set_plugin_default();
419+
(this._vieux._instance || this._vieux).set_plugin();
420420
return;
421421
}
422422
}
@@ -747,14 +747,14 @@ class PerspectiveViewer extends ActionElement {
747747
this.removeAttribute("column-pivots");
748748
this.removeAttribute("filters");
749749
this.removeAttribute("sort");
750-
this.removeAttribute("expressions");
751750
this.removeAttribute("aggregates");
752751
if (this._initial_col_order) {
753752
this.setAttribute("columns", JSON.stringify(this._initial_col_order));
754753
} else {
755754
this.removeAttribute("columns");
756755
}
757756

757+
this.removeAttribute("expressions");
758758
this.removeAttribute("plugin");
759759
this._vieux.get_plugin().then(plugin => {
760760
plugin.restore({});

packages/perspective-viewer/src/js/viewer/action_element.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ export class ActionElement extends DomElement {
254254
this._setAttributeSafe("plugin", plugin.name);
255255
}
256256

257-
this._plugin_information.classList.add("hidden");
258257
this._active_columns.classList.remove("one_lock", "two_lock");
259258
const classname = ["one_lock", "two_lock"][plugin.initial?.count - 1];
260259
if (classname) {
@@ -300,12 +299,5 @@ export class ActionElement extends DomElement {
300299
this._vieux.addEventListener("perspective-vieux-reset", () => this.reset());
301300
this._vieux.addEventListener("-perspective-plugin-changed", ({detail}) => this._vis_selector_changed(detail));
302301
this._vieux.addEventListener("-perspective-add-expression", ({detail}) => this._save_expression(detail));
303-
304-
this._plugin_information_action.addEventListener("click", async () => {
305-
let plugin = await this._vieux.get_plugin();
306-
this._debounce_update({ignore_size_check: true, limit_points: false});
307-
this._plugin_information.classList.add("hidden");
308-
plugin.render_warning = false;
309-
});
310302
}
311303
}

packages/perspective-viewer/src/js/viewer/cancel_task.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/perspective-viewer/src/js/viewer/dom_element.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ export class DomElement extends PerspectiveElement {
456456
this.shadowRoot.querySelector("#columns_container").style.visibility = "visible";
457457
}
458458

459+
_show_top_panel() {
460+
this.shadowRoot.querySelector("#top_panel").style.visibility = "visible";
461+
}
462+
459463
_show_side_panel_actions() {
460464
this.shadowRoot.querySelector("#side_panel__actions").style.visibility = "visible";
461465
}
@@ -560,9 +564,6 @@ export class DomElement extends PerspectiveElement {
560564
this._top_panel = this.shadowRoot.querySelector("#top_panel");
561565
this._sort = this.shadowRoot.querySelector("#sort");
562566
this._transpose_button = this.shadowRoot.querySelector("#transpose_button");
563-
this._plugin_information = this.shadowRoot.querySelector(".plugin_information");
564-
this._plugin_information_action = this.shadowRoot.querySelector(".plugin_information__action");
565-
this._plugin_information_message = this.shadowRoot.querySelector("#plugin_information_count");
566567
this._columns_container = this.shadowRoot.querySelector("#columns_container");
567568
}
568569

packages/perspective-viewer/src/js/viewer/dragdrop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function drop(ev) {
7777
if (filtering) {
7878
this.setAttribute(name, JSON.stringify(columns.concat([data])));
7979
} else if (name.indexOf("sort") > -1) {
80-
this.setAttribute(name, JSON.stringify(columns.concat([[data[0]]])));
80+
this.setAttribute(name, JSON.stringify(columns.concat([[data[0], "asc"]])));
8181
} else {
8282
this.setAttribute(name, JSON.stringify(columns.concat([data[0]])));
8383
}

0 commit comments

Comments
 (0)