From e38842642c10f5d1414a6fa2c2767437049f942c Mon Sep 17 00:00:00 2001 From: Jun Tan Date: Thu, 30 Sep 2021 12:10:28 -0400 Subject: [PATCH 01/10] Fix #1562, fix updates, editing in jlab --- binder/requirements.txt | 2 +- .../perspective-jupyterlab/src/js/view.js | 67 ++++++++----------- .../test/jupyter/widget.spec.js | 58 ++++++++++++++++ python/perspective/perspective/core/plugin.py | 2 +- .../perspective/tests/core/test_plugin.py | 2 +- .../perspective/tests/viewer/test_validate.py | 2 +- .../perspective/tests/viewer/test_viewer.py | 6 +- .../perspective/perspective/viewer/viewer.py | 4 +- .../perspective/viewer/viewer_traitlets.py | 2 +- 9 files changed, 95 insertions(+), 50 deletions(-) diff --git a/binder/requirements.txt b/binder/requirements.txt index 9bf94a49b7..cc11ec17aa 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,4 +1,4 @@ ipywidgets==7.5.1 -jupyterlab==3.0.14 +jupyterlab==3.1.14 pandas==0.25.3 pyarrow==3.0.0 \ No newline at end of file diff --git a/packages/perspective-jupyterlab/src/js/view.js b/packages/perspective-jupyterlab/src/js/view.js index e3380c9857..abbafb2a70 100644 --- a/packages/perspective-jupyterlab/src/js/view.js +++ b/packages/perspective-jupyterlab/src/js/view.js @@ -110,25 +110,7 @@ export class PerspectiveView extends DOMWidgetView { this.model.on("change:plugin_config", this.plugin_config_changed, this); this.model.on("change:dark", this.dark_changed, this); this.model.on("change:editable", this.editable_changed, this); - // Watch the viewer DOM so that widget state is always synchronized with - // DOM attributes. - const observer = new MutationObserver( - this._synchronize_state.bind(this) - ); - observer.observe(this.pWidget.viewer, { - attributes: true, - attributeFilter: [ - "plugin", - "columns", - "row-pivots", - "column-pivots", - "aggregates", - "sort", - "filters", - "expressions", - ], - subtree: false, - }); + /** * Request a table from the manager. If a table has been loaded, proxy * it and kick off subsequent operations. @@ -239,7 +221,7 @@ export class PerspectiveView extends DOMWidgetView { get client_worker() { if (!this._client_worker) { - this._client_worker = perspective.worker(); + this._client_worker = perspective.shared_worker(); } return this._client_worker; } @@ -276,30 +258,33 @@ export class PerspectiveView extends DOMWidgetView { // the table on the client, setting up editing if necessary. this.perspective_client .open_table(msg.data["table_name"]) - .then((kernel_table) => kernel_table.view()) - .then((kernel_view) => kernel_view.to_arrow()) - .then(async (arrow) => { + .then(async (kernel_table) => { + const kernel_view = await kernel_table.view(); + const arrow = await kernel_view.to_arrow(); + // Create a client side table - const client_table = this.client_worker.table( + let client_table = this.client_worker.table( arrow, table_options ); + // Need to await the table and get the instance + // separately as load() only takes a promise + // to a table and not the instance itself. const client_table2 = await client_table; + if (this.pWidget.editable) { - // Set up client/server editing + await this.pWidget.load(client_table); + + // Allow edits from the client Perspective to + // feed back to the kernel. + const client_edit_port = + await this.pWidget.getEditPort(); + const kernel_edit_port = + await kernel_table.make_port(); + const client_view = await client_table2.view(); - // table.view().then(client_view => { - let client_edit_port, server_edit_port; - // Create ports on the client and kernel. - Promise.all([ - this.pWidget.load(client_table), - this.pWidget.getEditPort(), - kernel_table.make_port(), - ]).then((outs) => { - client_edit_port = outs[1]; - server_edit_port = outs[2]; - }); + // When the client updates, if the update // comes through the edit port then forward // it to the server. @@ -307,7 +292,7 @@ export class PerspectiveView extends DOMWidgetView { (updated) => { if (updated.port_id === client_edit_port) { kernel_table.update(updated.delta, { - port_id: server_edit_port, + port_id: kernel_edit_port, }); } }, @@ -315,12 +300,13 @@ export class PerspectiveView extends DOMWidgetView { mode: "row", } ); + // If the server updates, and the edit is // not coming from the server edit port, // then synchronize state with the client. kernel_view.on_update( (updated) => { - if (updated.port_id !== server_edit_port) { + if (updated.port_id !== kernel_edit_port) { client_table2.update(updated.delta); // any port, we dont care } }, @@ -331,7 +317,7 @@ export class PerspectiveView extends DOMWidgetView { } else { // Load the table and mirror updates from the // kernel. - this.pWidget.load(client_table); + await this.pWidget.load(client_table); kernel_view.on_update( (updated) => client_table2.update(updated.delta), @@ -362,8 +348,9 @@ export class PerspectiveView extends DOMWidgetView { */ remove() { + // Delete the but do not terminate the shared + // worker as it is shared across other widgets. this.pWidget.delete(); - this.client_worker.terminate(); } /** diff --git a/packages/perspective-jupyterlab/test/jupyter/widget.spec.js b/packages/perspective-jupyterlab/test/jupyter/widget.spec.js index 684512c8ae..8caf325b00 100644 --- a/packages/perspective-jupyterlab/test/jupyter/widget.spec.js +++ b/packages/perspective-jupyterlab/test/jupyter/widget.spec.js @@ -53,6 +53,64 @@ utils.with_jupyterlab(process.env.__JUPYTERLAB_PORT__, () => { expect(num_rows).toEqual(5); } ); + + test.jupyterlab( + "Loads data", + [ + "w = perspective.PerspectiveWidget(arrow_data, columns=['f64', 'str', 'datetime'])", + "w", + ], + async (page) => { + const viewer = await default_body(page); + const num_columns = await viewer.evaluate( + async (viewer) => { + const tbl = viewer.querySelector("regular-table"); + return tbl.querySelector("thead tr") + .childElementCount; + } + ); + + expect(num_columns).toEqual(3); + + const num_rows = await viewer.evaluate(async (viewer) => { + const tbl = viewer.querySelector("regular-table"); + return tbl.querySelectorAll("tbody tr").length; + }); + + expect(num_rows).toEqual(5); + } + ); + + test.jupyterlab( + "Loads updates", + [ + [ + "table = perspective.Table(arrow_data)", + "w = perspective.PerspectiveWidget(table, columns=['f64', 'str', 'datetime'])", + ].join("\n"), + "w", + "table.update(arrow_data)", + ], + async (page) => { + const viewer = await default_body(page); + const num_columns = await viewer.evaluate( + async (viewer) => { + const tbl = viewer.querySelector("regular-table"); + return tbl.querySelector("thead tr") + .childElementCount; + } + ); + + expect(num_columns).toEqual(3); + + const num_rows = await viewer.evaluate(async (viewer) => { + const tbl = viewer.querySelector("regular-table"); + return tbl.querySelectorAll("tbody tr").length; + }); + + expect(num_rows).toEqual(10); + } + ); }, {name: "Simple", root: path.join(__dirname, "..", "..")} ); diff --git a/python/perspective/perspective/core/plugin.py b/python/perspective/perspective/core/plugin.py index 6391aba983..77ef75f775 100644 --- a/python/perspective/perspective/core/plugin.py +++ b/python/perspective/perspective/core/plugin.py @@ -17,7 +17,7 @@ class Plugin(Enum): >>> widget = PerspectiveWidget(data, plugin=Plugin.TREEMAP) """ - GRID = "datagrid" + GRID = "Datagrid" YBAR = "Y Bar" XBAR = "X Bar" diff --git a/python/perspective/perspective/tests/core/test_plugin.py b/python/perspective/perspective/tests/core/test_plugin.py index a15d623f9c..d15e3ce86e 100644 --- a/python/perspective/perspective/tests/core/test_plugin.py +++ b/python/perspective/perspective/tests/core/test_plugin.py @@ -16,7 +16,7 @@ class TestPlugin: def test_plugin_widget_load_grid(self): data = {"a": [1, 2, 3], "b": ["a", "b", "c"]} widget = PerspectiveWidget(data, plugin=Plugin.GRID) - assert widget.plugin == "datagrid" + assert widget.plugin == "Datagrid" def test_plugin_widget_load(self): data = {"a": [1, 2, 3], "b": ["a", "b", "c"]} diff --git a/python/perspective/perspective/tests/viewer/test_validate.py b/python/perspective/perspective/tests/viewer/test_validate.py index b7495b995f..e78c45dfd0 100644 --- a/python/perspective/perspective/tests/viewer/test_validate.py +++ b/python/perspective/perspective/tests/viewer/test_validate.py @@ -18,7 +18,7 @@ def test_validate_plugin_valid_instance(self): assert validate.validate_plugin(Plugin.XBAR) == "X Bar" def test_validate_plugin_valid_instance_datagrid(self): - assert validate.validate_plugin(Plugin.GRID) == "datagrid" + assert validate.validate_plugin(Plugin.GRID) == "Datagrid" def test_validate_plugin_valid_string(self): assert validate.validate_plugin("X Bar") == "X Bar" diff --git a/python/perspective/perspective/tests/viewer/test_viewer.py b/python/perspective/perspective/tests/viewer/test_viewer.py index 0bc3b47d1d..43f3f18ea9 100644 --- a/python/perspective/perspective/tests/viewer/test_viewer.py +++ b/python/perspective/perspective/tests/viewer/test_viewer.py @@ -189,7 +189,7 @@ def test_viewer_reset(self): viewer.load(table) assert viewer.filters == [["a", "==", 2]] viewer.reset() - assert viewer.plugin == "datagrid" + assert viewer.plugin == "Datagrid" assert viewer.filters == [] # delete @@ -229,7 +229,7 @@ def test_save_restore(self): # reset configuration viewer.reset() - assert viewer.plugin == "datagrid" + assert viewer.plugin == "Datagrid" assert viewer.filters == [] assert viewer.editable is False assert viewer.expressions == [] @@ -242,7 +242,7 @@ def test_save_restore(self): assert viewer.expressions == ['"a" * 2'] def test_save_restore_plugin_config(self): - viewer = PerspectiveViewer(plugin="datagrid", plugin_config={"a": {"fixed": 4}}) + viewer = PerspectiveViewer(plugin="Datagrid", plugin_config={"a": {"fixed": 4}}) config = viewer.save() assert config["plugin_config"] == { diff --git a/python/perspective/perspective/viewer/viewer.py b/python/perspective/perspective/viewer/viewer.py index 95ae93527b..1576de68ce 100644 --- a/python/perspective/perspective/viewer/viewer.py +++ b/python/perspective/perspective/viewer/viewer.py @@ -57,7 +57,7 @@ class PerspectiveViewer(PerspectiveTraitlets, object): def __init__( self, - plugin="datagrid", + plugin="Datagrid", columns=None, row_pivots=None, column_pivots=None, @@ -266,7 +266,7 @@ def reset(self): self.expressions = [] self.aggregates = {} self.columns = [] - self.plugin = "datagrid" + self.plugin = "Datagrid" self.plugin_config = {} self.editable = False diff --git a/python/perspective/perspective/viewer/viewer_traitlets.py b/python/perspective/perspective/viewer/viewer_traitlets.py index 1e891af82e..58dfeafcc9 100644 --- a/python/perspective/perspective/viewer/viewer_traitlets.py +++ b/python/perspective/perspective/viewer/viewer_traitlets.py @@ -35,7 +35,7 @@ class PerspectiveTraitlets(HasTraits): """ # `perspective-viewer` options - plugin = Unicode("datagrid").tag(sync=True) + plugin = Unicode("Datagrid").tag(sync=True) columns = List(default_value=[]).tag(sync=True) row_pivots = List(trait=Unicode(), default_value=[]).tag(sync=True, o=True) column_pivots = List(trait=Unicode(), default_value=[]).tag(sync=True) From d716a6a4a41da885c67c15fd6d60672395b102e3 Mon Sep 17 00:00:00 2001 From: Jun Tan Date: Fri, 1 Oct 2021 17:19:29 -0400 Subject: [PATCH 02/10] Fix #1566, remove deprecated flags from WASM debug build --- cpp/perspective/CMakeLists.txt | 4 +- .../test/js/expressions/functionality.js | 31 +++++++++ python/perspective/perspective/table/table.py | 8 ++- .../perspective/tests/manager/test_manager.py | 5 +- .../tests/table/test_view_expression.py | 64 +++++++++++++++++-- 5 files changed, 101 insertions(+), 11 deletions(-) diff --git a/cpp/perspective/CMakeLists.txt b/cpp/perspective/CMakeLists.txt index dd4570d430..f5c7a7e3c2 100644 --- a/cpp/perspective/CMakeLists.txt +++ b/cpp/perspective/CMakeLists.txt @@ -232,9 +232,9 @@ if (PSP_WASM_BUILD) if(CMAKE_BUILD_TYPE_LOWER STREQUAL debug) set(OPT_FLAGS " \ -O0 \ - -g4 \ + -g3 \ + -gsource-map \ --profiling \ - -s WARN_UNALIGNED=1 \ -Wcast-align \ -Wover-aligned \ ") diff --git a/packages/perspective/test/js/expressions/functionality.js b/packages/perspective/test/js/expressions/functionality.js index f885795879..32c28926cb 100644 --- a/packages/perspective/test/js/expressions/functionality.js +++ b/packages/perspective/test/js/expressions/functionality.js @@ -2614,6 +2614,26 @@ module.exports = (perspective) => { 'max(100, "a")': "float", "more columns": "string", }); + + let i = 0; + for (const alias of [ + "abc", + "def", + expressions[2], + "new column", + expressions[4], + expressions[5], + "more columns", + expressions[7], + expressions[8], + expressions[9], + expressions[10], + ]) { + expect(results.expression_alias[alias]).toEqual( + expressions[i] + ); + i++; + } table.delete(); }); @@ -2638,6 +2658,7 @@ module.exports = (perspective) => { 'max(100, "a")', // valid ]; const results = await table.validate_expressions(expressions); + expect(results.expression_schema).toEqual({ '"a" + "d"': "float", '"c"': "string", @@ -2646,6 +2667,11 @@ module.exports = (perspective) => { 'max(100, "a")': "float", "concat(\"c\", ' ', \"c\", 'abc')": "string", }); + + for (const expr of expressions) { + expect(results.expression_alias[expr]).toEqual(expr); + } + table.delete(); }); @@ -2672,6 +2698,11 @@ module.exports = (perspective) => { "bucket(\"b\", 'M')": "date", 'upper("c")': "string", }); + + for (const expr of expressions) { + expect(results.expression_alias[expr]).toEqual(expr); + } + table.delete(); }); diff --git a/python/perspective/perspective/table/table.py b/python/perspective/perspective/table/table.py index 0d9a1a32b8..bcb971be66 100644 --- a/python/perspective/perspective/table/table.py +++ b/python/perspective/perspective/table/table.py @@ -185,7 +185,7 @@ def validate_expressions(self, expressions, as_string=False): as_string (:obj:`bool`): If True, returns the data types as string representations so they can be serialized. """ - validated = {"expression_schema": {}, "errors": {}} + validated = {"expression_schema": {}, "errors": {}, "expression_alias": {}} if len(expressions) == 0: return validated @@ -195,9 +195,15 @@ def validate_expressions(self, expressions, as_string=False): expression_schema = validation_results.get_expression_schema() expression_errors = validation_results.get_expression_errors() + for expression in expressions: + # expression_alias can be used to map the alias to the + # full expression string in the UI. + validated["expression_alias"][expression[0]] = expression[1] + for (alias, dtype) in iteritems(expression_schema): if not as_string: dtype = _str_to_pythontype(dtype) + validated["expression_schema"][alias] = expression_schema[alias] for (alias, error) in iteritems(expression_errors): diff --git a/python/perspective/perspective/tests/manager/test_manager.py b/python/perspective/perspective/tests/manager/test_manager.py index dbec67fde9..b962dc5278 100644 --- a/python/perspective/perspective/tests/manager/test_manager.py +++ b/python/perspective/perspective/tests/manager/test_manager.py @@ -332,7 +332,10 @@ def test_manager_table_validate_expressions(self): "expression_schema": { "abc": "float" }, - "errors": {} + "errors": {}, + "expression_alias": { + "abc": '// abc \n "a" + "a"' + } } }) diff --git a/python/perspective/perspective/tests/table/test_view_expression.py b/python/perspective/perspective/tests/table/test_view_expression.py index bb75e49932..044a1c4e0f 100644 --- a/python/perspective/perspective/tests/table/test_view_expression.py +++ b/python/perspective/perspective/tests/table/test_view_expression.py @@ -19,6 +19,7 @@ def test_table_validate_expressions_empty(self): table = Table({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]}) validate = table.validate_expressions([]) assert validate["expression_schema"] == {} + assert validate["expression_alias"] == {} assert validate["errors"] == {} def test_view_expression_schema_empty(self): @@ -27,9 +28,50 @@ def test_view_expression_schema_empty(self): assert view.to_columns() == {"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]} assert view.expression_schema() == {} + def test_view_validate_expressions_alias_map_errors(self): + table = Table({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]}) + expressions = [ + '// x\n"a"', + '// y\n"b" * 0.5', + "// c\n'abcdefg'", + "// d\ntrue and false", + '// e\nfloat("a") > 2 ? null : 1', + "// f\ntoday()", + "// g\nnow()", + "// h\nlength(123)", + ] + + validated = table.validate_expressions(expressions) + + aliases = ["x", "y", "c", "d", "e", "f", "g", "h"] + + # Errored should also be in aliases + for idx, alias in enumerate(aliases): + assert validated["expression_alias"][alias] == expressions[idx] + + def test_view_validate_expressions_alias_map(self): + table = Table({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]}) + expressions = [ + '// x\n"a"', + '// y\n"b" * 0.5', + "// c\n'abcdefg'", + "// d\ntrue and false", + '// e\nfloat("a") > 2 ? null : 1', + "// f\ntoday()", + "// g\nnow()", + "// h\nlength('abcd')", + ] + + validated = table.validate_expressions(expressions) + + aliases = ["x", "y", "c", "d", "e", "f", "g", "h"] + + for idx, alias in enumerate(aliases): + assert validated["expression_alias"][alias] == expressions[idx] + def test_view_expression_schema_all_types(self): table = Table({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]}) - view = table.view(expressions=[ + expressions = [ '"a"', '"b" * 0.5', "'abcdefg'", @@ -37,8 +79,10 @@ def test_view_expression_schema_all_types(self): 'float("a") > 2 ? null : 1', "today()", "now()", - "length('abcd')" - ]) + "length('abcd')", + ] + + view = table.view(expressions=expressions) assert view.expression_schema() == { '"a"': int, '"b" * 0.5': float, @@ -47,12 +91,13 @@ def test_view_expression_schema_all_types(self): 'float("a") > 2 ? null : 1': float, "today()": date, "now()": datetime, - "length('abcd')": float + "length('abcd')": float, } result = view.to_columns() today = datetime(date.today().year, date.today().month, date.today().day) del result["now()"] # no need to match datetime.now() + assert result == { "a": [1, 2, 3, 4], "b": [5, 6, 7, 8], @@ -65,12 +110,17 @@ def test_view_expression_schema_all_types(self): "length('abcd')": [4 for _ in range(4)] } + validated = table.validate_expressions(expressions) + + for expr in expressions: + assert validated["expression_alias"][expr] == expr + def test_table_validate_expressions_with_errors(self): table = Table({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]}) - validate = table.validate_expressions( - ['"Sales" + "Profit"', "datetime()", "string()", "for () {}"] - ) + expressions = ['"Sales" + "Profit"', "datetime()", "string()", "for () {}"] + validate = table.validate_expressions(expressions) assert validate["expression_schema"] == {} + assert validate["expression_alias"] == {expr: expr for expr in expressions} assert validate["errors"] == { '"Sales" + "Profit"': { "column": 0, From 1eb9346826cfd05517e9cb7680047163e0475375 Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Sat, 9 Oct 2021 00:11:00 -0400 Subject: [PATCH 03/10] Fix example projects --- examples/blocks/src/custom/custom_plugin.js | 30 +- examples/blocks/src/custom/index.html | 10 +- examples/blocks/src/editable/index.html | 7 +- examples/blocks/src/iex/index.css | 4 + examples/blocks/src/iex/index.html | 6 +- examples/blocks/src/iex/index.js | 2 + examples/blocks/src/iex/layout.json | 2 +- examples/blocks/src/mandelbrot/index.html | 126 +- examples/blocks/src/ohlc/FTSE100.csv | 1316 ----------------- examples/blocks/src/ohlc/index.html | 57 - examples/blocks/src/workspace/index.html | 37 - examples/blocks/src/workspace/workspace.js | 31 - examples/git-history/index.html | 83 +- examples/git-history/server.js | 15 +- .../remote-express-typescript/package.json | 21 - examples/remote-express/README.md | 5 - .../assets/index.css | 0 .../assets/index.html | 0 examples/remote-express/index.css | 31 - examples/remote-express/index.html | 68 - examples/remote-express/package.json | 10 +- examples/remote-express/server.js | 29 - .../src/server.ts | 0 .../tsconfig.json | 0 examples/remote-workspace/src/index.js | 12 +- examples/tornado-python/index.html | 4 +- examples/tornado-streaming-python/index.html | 131 +- examples/webpack-cross-origin/src/index.css | 2 + examples/webpack-cross-origin/src/index.js | 2 +- examples/webpack/src/index.js | 2 +- .../workspace-editing-python/src/index.js | 7 +- examples/workspace/src/index.js | 4 +- 32 files changed, 239 insertions(+), 1815 deletions(-) delete mode 100644 examples/blocks/src/ohlc/FTSE100.csv delete mode 100644 examples/blocks/src/ohlc/index.html delete mode 100644 examples/blocks/src/workspace/index.html delete mode 100644 examples/blocks/src/workspace/workspace.js delete mode 100644 examples/remote-express-typescript/package.json delete mode 100644 examples/remote-express/README.md rename examples/{remote-express-typescript => remote-express}/assets/index.css (100%) rename examples/{remote-express-typescript => remote-express}/assets/index.html (100%) delete mode 100644 examples/remote-express/index.css delete mode 100644 examples/remote-express/index.html delete mode 100644 examples/remote-express/server.js rename examples/{remote-express-typescript => remote-express}/src/server.ts (100%) rename examples/{remote-express-typescript => remote-express}/tsconfig.json (100%) diff --git a/examples/blocks/src/custom/custom_plugin.js b/examples/blocks/src/custom/custom_plugin.js index f0c73320d9..724a913c43 100644 --- a/examples/blocks/src/custom/custom_plugin.js +++ b/examples/blocks/src/custom/custom_plugin.js @@ -107,20 +107,6 @@ function make_led_cell(td, metadata) { } } -function make_bar_chart(td, metadata, max) { - td.style.background = ""; - td.style.border = ``; - if (!metadata.value) { - } else { - max = Math.max(max, metadata.value || 0); - let v = (metadata.value || 0) / max; - td.innerHTML = `
`; - } - return max; -} - function make_flag(td, metadata, cache, clean_name) { td.style.background = ""; td.style.border = ``; @@ -178,7 +164,7 @@ class CustomDatagridPlugin extends customElements.get( const viewer = this.parentElement; const datagrid = this.datagrid; if (this._dirty) { - await this.refresh_cache(viewer.view); + await this.refresh_cache(); } const cache = clone_img_cache(); @@ -205,8 +191,6 @@ class CustomDatagridPlugin extends customElements.get( ); if (type === "float") { make_led_cell(td, metadata); - } else if (type === "integer") { - this._max = make_bar_chart(td, metadata, this._max); } else if (clean_name in states) { make_flag(td, metadata, cache, clean_name); } else { @@ -215,7 +199,8 @@ class CustomDatagridPlugin extends customElements.get( } } - async refresh_cache(view) { + async refresh_cache() { + const view = this._view; this._column_paths = await view.column_paths(); this._row_pivots = await view.get_config()["row_pivots"]; this._schema = await view.schema(); @@ -224,13 +209,15 @@ class CustomDatagridPlugin extends customElements.get( async activate(view) { await super.activate(view); + this._view = view; this._dirty = true; if (!this._custom_initialized) { const viewer = this.parentElement; const datagrid = this.datagrid; this._max = -Infinity; await this.refresh_cache(view); - this._table_schema = await viewer.table.schema(); + const table = await viewer.getTable(); + this._table_schema = await table.schema(); viewer.addEventListener("perspective-config-update", async () => { this._max = -Infinity; this._dirty = true; @@ -246,4 +233,7 @@ customElements.define( "perspective-viewer-custom-datagrid", CustomDatagridPlugin ); -window.registerPlugin("perspective-viewer-custom-datagrid"); + +customElements + .get("perspective-viewer") + .registerPlugin("perspective-viewer-custom-datagrid"); diff --git a/examples/blocks/src/custom/index.html b/examples/blocks/src/custom/index.html index a0711397f4..42d2cf7cdb 100644 --- a/examples/blocks/src/custom/index.html +++ b/examples/blocks/src/custom/index.html @@ -16,9 +16,7 @@ - + - - - - - - - + + + + + + + + @@ -171,7 +166,7 @@
Iterations - +
@@ -180,14 +175,7 @@
- - + @@ -203,7 +191,7 @@ args.vxy = args.vxy || 0; args.c = args.c || iterations; } - + function iter_args(cx, cy, iterations, args = {}) { if (args.vxx + args.vyy <= 4) { args.vxy = args.vx * args.vy; @@ -228,14 +216,14 @@ json[index] = new_args; } - function *mandel_iter(width, height, batch) { + function* mandel_iter(width, height, batch) { for (let bi = 0; bi < batch; ++bi) { for (let ix = 0; ix < width; ++ix) { for (let iy = 0; iy < height; ++iy) { yield [ix, iy]; } } - } + } } async function mandelbrot(table, view, xmin, xmax, ymin, ymax, width, height, iterations, batch) { @@ -251,7 +239,7 @@ run.innerHTML = `Stop (${ii * batch}/${iterations})`; } } finally { - run.innerHTML = `Run`; + run.innerHTML = `Run`; } view.delete(); } @@ -270,17 +258,17 @@ }; function make_range(x, y, range, name) { - const title = () => - name + " [" + - x.valueAsNumber.toFixed(1) + ", " + + const title = () => + name + " [" + + x.valueAsNumber.toFixed(1) + ", " + y.valueAsNumber.toFixed(1) + "]"; - x.addEventListener("input", () => { + x.addEventListener("input", () => { x.value = Math.min(x.valueAsNumber, y.valueAsNumber - 0.1); range.innerHTML = title(); }); - - y.addEventListener("input", () => { + + y.addEventListener("input", () => { y.value = Math.max(x.valueAsNumber + 0.1, y.valueAsNumber); range.innerHTML = title(); }); @@ -310,16 +298,23 @@ state.table = await worker.table(SCHEMA); state.view = await state.table.view(); mandelbrot(state.table, state.view, ...[ - "xmin", - "xmax", - "ymin", - "ymax", - "width", + "xmin", + "xmax", + "ymin", + "ymax", + "width", "height", - "iterations", + "iterations", "batch" ].map(x => window[x].valueAsNumber)); - window.viewer.load(state.table); + window.viewer.load(Promise.resolve(state.table)); + window.viewer.restore({ + plugin: "Heatmap", + row_pivots: ["x"], + column_pivots: ["y"], + columns: ["c"] + }); + if (old_table) { old_table.delete(); } @@ -328,6 +323,9 @@ // Main window.addEventListener("DOMContentLoaded", async function () { + const heatmap_plugin = await window.viewer.getPlugin("Heatmap"); + heatmap_plugin.max_cells = 10000; + make_range(xmin, xmax, xrange, "X"); make_range(ymin, ymax, yrange, "Y"); diff --git a/examples/blocks/src/ohlc/FTSE100.csv b/examples/blocks/src/ohlc/FTSE100.csv deleted file mode 100644 index 8e3e6d64c8..0000000000 --- a/examples/blocks/src/ohlc/FTSE100.csv +++ /dev/null @@ -1,1316 +0,0 @@ -Date,Price,Open,High,Low,Vol.,Change% -2019-03-13,7148.17,7128.25,7162.50,7128.25,0,-0.04 -2019-03-12,7151.15,7130.62,7166.55,7083.22,775290000,0.29 -2019-03-11,7130.62,7104.31,7181.61,7104.31,695140000,0.37 -2019-03-08,7104.31,7157.55,7157.55,7077.93,640780000,-0.74 -2019-03-07,7157.55,7196.00,7196.00,7126.57,712680000,-0.53 -2019-03-06,7196.00,7183.43,7211.83,7170.25,816150000,0.17 -2019-03-05,7183.43,7134.39,7191.65,7127.18,819860000,0.69 -2019-03-04,7134.39,7106.73,7166.19,7106.73,654230000,0.39 -2019-03-01,7106.73,7074.73,7129.72,7074.73,722480000,0.45 -2019-02-28,7074.73,7107.20,7107.20,7041.03,1010000000,-0.46 -2019-02-27,7107.20,7151.12,7151.12,7082.62,897620000,-0.61 -2019-02-26,7151.12,7183.74,7183.79,7091.59,892460000,-0.45 -2019-02-25,7183.74,7178.60,7210.70,7158.19,664870000,0.07 -2019-02-22,7178.60,7167.39,7220.52,7162.37,666720000,0.16 -2019-02-21,7167.39,7228.62,7228.78,7141.85,822590000,-0.85 -2019-02-20,7228.62,7179.17,7234.16,7177.95,887890000,0.69 -2019-02-19,7179.17,7219.47,7219.53,7162.80,643410000,-0.56 -2019-02-18,7219.47,7236.68,7242.09,7209.70,453430000,-0.24 -2019-02-15,7236.68,7197.01,7261.63,7185.23,709700000,0.55 -2019-02-14,7197.01,7190.84,7232.83,7183.01,535040000,0.09 -2019-02-13,7190.84,7133.14,7205.07,7133.14,578840000,0.81 -2019-02-12,7133.14,7129.11,7168.61,7121.72,542970000,0.06 -2019-02-11,7129.11,7071.18,7149.23,7071.18,565260000,0.82 -2019-02-08,7071.18,7093.58,7115.83,7064.90,548730000,-0.32 -2019-02-07,7093.58,7173.09,7187.51,7093.58,669720000,-1.11 -2019-02-06,7173.09,7177.37,7184.22,7146.65,618000000,-0.06 -2019-02-05,7177.37,7034.13,7180.71,7033.57,683460000,2.04 -2019-02-04,7034.13,7020.22,7046.58,7002.42,630900000,0.20 -2019-02-01,7020.22,6968.85,7024.45,6968.85,645350000,0.74 -2019-01-31,6968.85,6941.63,6994.88,6941.09,893090000,0.39 -2019-01-30,6941.63,6833.93,6967.70,6833.93,771900000,1.58 -2019-01-29,6833.93,6747.10,6860.34,6747.10,718590000,1.29 -2019-01-28,6747.10,6809.22,6812.53,6734.00,668240000,-0.91 -2019-01-25,6809.22,6818.95,6858.19,6806.77,749990000,-0.14 -2019-01-24,6818.95,6842.88,6854.59,6802.03,618510000,-0.35 -2019-01-23,6842.88,6901.39,6901.63,6834.30,666010000,-0.85 -2019-01-22,6901.39,6970.59,6970.59,6880.69,583460000,-0.99 -2019-01-21,6970.59,6968.33,6987.93,6954.52,488780000,0.03 -2019-01-18,6968.33,6834.92,6984.36,6834.92,820330000,1.95 -2019-01-17,6834.92,6862.68,6862.68,6799.03,600660000,-0.40 -2019-01-16,6862.68,6895.02,6912.44,6848.57,811960000,-0.47 -2019-01-15,6895.02,6855.02,6910.45,6849.63,708580000,0.58 -2019-01-14,6855.02,6918.18,6918.21,6841.74,704570000,-0.91 -2019-01-11,6918.18,6942.87,7001.94,6902.65,701510000,-0.36 -2019-01-10,6942.87,6906.63,6948.18,6860.82,630320000,0.52 -2019-01-09,6906.63,6861.60,6938.31,6861.60,887290000,0.66 -2019-01-08,6861.60,6810.88,6901.48,6804.89,672100000,0.74 -2019-01-07,6810.88,6837.42,6874.11,6778.01,759330000,-0.39 -2019-01-04,6837.42,6692.66,6850.37,6692.50,658880000,2.16 -2019-01-03,6692.66,6734.23,6753.14,6685.09,694920000,-0.62 -2019-01-02,6734.23,6728.13,6753.29,6599.48,633240000,0.09 -2018-12-31,6728.13,6733.97,6752.54,6718.32,232270000,-0.09 -2018-12-28,6733.97,6584.68,6742.48,6584.68,515160000,2.27 -2018-12-27,6584.68,6685.99,6728.49,6536.53,608360000,-1.52 -2018-12-24,6685.99,6721.17,6721.17,6661.04,198770000,-0.52 -2018-12-21,6721.17,6711.93,6733.00,6653.65,1650000000,0.14 -2018-12-20,6711.93,6765.94,6765.94,6646.45,929570000,-0.80 -2018-12-19,6765.94,6701.59,6785.16,6698.15,777370000,0.96 -2018-12-18,6701.59,6773.24,6773.24,6701.59,880780000,-1.06 -2018-12-17,6773.24,6845.17,6845.17,6761.38,734720000,-1.05 -2018-12-14,6845.17,6877.50,6877.50,6788.65,736010000,-0.47 -2018-12-13,6877.50,6880.19,6908.48,6848.98,757820000,-0.04 -2018-12-12,6880.19,6806.94,6902.19,6806.94,1100000000,1.08 -2018-12-11,6806.94,6721.54,6857.58,6721.54,867260000,1.27 -2018-12-10,6721.54,6778.11,6815.84,6719.17,891070000,-0.83 -2018-12-07,6778.11,6704.05,6868.27,6704.05,845320000,1.10 -2018-12-06,6704.05,6921.84,6921.84,6673.57,1060000000,-3.15 -2018-12-05,6921.84,7022.76,7028.65,6921.84,813440000,-1.44 -2018-12-04,7022.76,7062.41,7095.01,7002.71,844630000,-0.56 -2018-12-03,7062.41,6980.24,7145.49,6980.24,891140000,1.18 -2018-11-30,6980.24,7038.95,7042.07,6965.60,1220000000,-0.83 -2018-11-29,7038.95,7004.52,7078.37,7004.52,797790000,0.49 -2018-11-28,7004.52,7016.85,7057.03,6987.25,825360000,-0.18 -2018-11-27,7016.85,7036.00,7043.70,6983.98,855620000,-0.27 -2018-11-26,7036.00,6952.86,7050.96,6952.86,826830000,1.20 -2018-11-23,6952.86,6960.32,6987.53,6912.30,707660000,-0.11 -2018-11-22,6960.32,7050.23,7050.43,6944.95,786800000,-1.28 -2018-11-21,7050.23,6947.92,7058.56,6947.92,864500000,1.47 -2018-11-20,6947.92,7000.89,7010.10,6904.21,851710000,-0.76 -2018-11-19,7000.89,7013.88,7070.46,6997.83,800440000,-0.19 -2018-11-16,7013.88,7038.01,7092.44,6968.99,1040000000,-0.34 -2018-11-15,7038.01,7033.79,7081.88,6979.57,1290000000,0.06 -2018-11-14,7033.79,7053.76,7113.59,6979.68,953790000,-0.28 -2018-11-13,7053.76,7053.08,7103.97,7016.64,1080000000,0.01 -2018-11-12,7053.08,7105.34,7186.31,7053.08,730620000,-0.74 -2018-11-09,7105.34,7140.68,7140.68,7070.80,672890000,-0.49 -2018-11-08,7140.68,7117.28,7171.69,7115.01,697800000,0.33 -2018-11-07,7117.28,7040.68,7136.75,7040.68,698980000,1.09 -2018-11-06,7040.68,7103.84,7117.50,7027.45,666520000,-0.89 -2018-11-05,7103.84,7094.12,7140.37,7077.40,570490000,0.14 -2018-11-02,7094.12,7114.66,7196.39,7094.12,824950000,-0.29 -2018-11-01,7114.66,7128.10,7165.61,7085.74,1060000000,-0.19 -2018-10-31,7128.10,7035.85,7161.54,7035.85,923080000,1.31 -2018-10-30,7035.85,7026.32,7060.06,6983.68,774720000,0.14 -2018-10-29,7026.32,6939.56,7085.88,6939.56,804710000,1.25 -2018-10-26,6939.56,7004.10,7004.16,6851.59,803060000,-0.92 -2018-10-25,7004.10,6962.98,7004.10,6885.99,853930000,0.59 -2018-10-24,6962.98,6955.21,7049.83,6955.21,797990000,0.11 -2018-10-23,6955.21,7042.80,7042.80,6928.65,1010000000,-1.24 -2018-10-22,7042.80,7049.80,7114.12,7042.05,806700000,-0.10 -2018-10-19,7049.80,7026.99,7070.38,7012.56,800350000,0.32 -2018-10-18,7026.99,7054.60,7078.76,7026.74,692860000,-0.39 -2018-10-17,7054.60,7059.40,7089.03,7019.41,707140000,-0.07 -2018-10-16,7059.40,7029.22,7062.08,6998.93,786100000,0.43 -2018-10-15,7029.22,6995.91,7038.23,6961.28,674960000,0.48 -2018-10-12,6995.91,7006.93,7073.99,6994.78,903680000,-0.16 -2018-10-11,7006.93,7145.74,7145.74,6998.02,1210000000,-1.94 -2018-10-10,7145.74,7237.59,7242.31,7145.74,1060000000,-1.27 -2018-10-09,7237.59,7233.33,7247.64,7184.28,789690000,0.06 -2018-10-08,7233.33,7318.54,7319.84,7233.33,695800000,-1.16 -2018-10-05,7318.54,7418.34,7421.12,7318.54,758630000,-1.35 -2018-10-04,7418.34,7510.28,7510.28,7411.31,826760000,-1.22 -2018-10-03,7510.28,7474.55,7524.06,7474.55,849120000,0.48 -2018-10-02,7474.55,7495.67,7495.67,7444.80,843120000,-0.28 -2018-10-01,7495.67,7510.20,7526.20,7466.67,746180000,-0.19 -2018-09-28,7510.20,7545.44,7548.36,7474.67,943920000,-0.47 -2018-09-27,7545.44,7511.49,7552.02,7490.94,666220000,0.45 -2018-09-26,7511.49,7507.56,7522.06,7490.20,693150000,0.05 -2018-09-25,7507.56,7458.41,7515.94,7455.22,791700000,0.66 -2018-09-24,7458.41,7490.23,7491.25,7450.53,710210000,-0.42 -2018-09-21,7490.23,7367.32,7495.26,7367.32,1550000000,1.67 -2018-09-20,7367.32,7331.12,7368.43,7324.01,891660000,0.49 -2018-09-19,7331.12,7300.23,7346.11,7279.92,785950000,0.42 -2018-09-18,7300.23,7302.10,7320.07,7281.98,722030000,-0.03 -2018-09-17,7302.10,7304.04,7318.77,7267.83,640190000,-0.03 -2018-09-14,7304.04,7281.57,7323.83,7281.57,595140000,0.31 -2018-09-13,7281.57,7313.36,7319.57,7275.14,681150000,-0.43 -2018-09-12,7313.36,7273.54,7325.25,7250.84,698110000,0.55 -2018-09-11,7273.54,7279.30,7280.48,7220.50,664030000,-0.08 -2018-09-10,7279.30,7277.70,7307.85,7256.51,717860000,0.02 -2018-09-07,7277.70,7318.96,7328.30,7227.07,889090000,-0.56 -2018-09-06,7318.96,7383.28,7397.74,7313.12,743690000,-0.87 -2018-09-05,7383.28,7457.86,7457.86,7357.98,792990000,-1.00 -2018-09-04,7457.86,7504.60,7535.12,7437.65,672990000,-0.62 -2018-09-03,7504.60,7432.42,7516.06,7432.18,468850000,0.97 -2018-08-31,7432.42,7516.03,7516.46,7428.67,838070000,-1.11 -2018-08-30,7516.03,7563.21,7563.21,7497.54,642440000,-0.62 -2018-08-29,7563.21,7617.22,7635.74,7545.08,709980000,-0.71 -2018-08-28,7617.22,7577.49,7636.72,7577.49,603830000,0.52 -2018-08-24,7577.49,7563.22,7587.19,7557.67,523570000,0.19 -2018-08-23,7563.22,7574.24,7602.10,7560.85,592640000,-0.15 -2018-08-22,7574.24,7565.70,7607.23,7531.24,630160000,0.11 -2018-08-21,7565.70,7591.26,7601.65,7557.34,560350000,-0.34 -2018-08-20,7591.26,7558.59,7616.15,7558.59,576840000,0.43 -2018-08-17,7558.59,7556.38,7577.68,7514.26,621370000,0.03 -2018-08-16,7556.38,7497.87,7565.18,7497.87,795280000,0.78 -2018-08-15,7497.87,7611.64,7632.07,7477.05,994260000,-1.49 -2018-08-14,7611.64,7642.45,7665.24,7599.66,787260000,-0.40 -2018-08-13,7642.45,7667.01,7667.33,7614.48,612150000,-0.32 -2018-08-10,7667.01,7741.77,7741.77,7657.72,684690000,-0.97 -2018-08-09,7741.77,7776.65,7776.77,7714.52,582940000,-0.45 -2018-08-08,7776.65,7718.48,7790.17,7707.30,621150000,0.75 -2018-08-07,7718.48,7663.78,7752.08,7663.20,696340000,0.71 -2018-08-06,7663.78,7659.10,7681.86,7636.60,838430000,0.06 -2018-08-03,7659.10,7575.93,7665.16,7575.93,670040000,1.10 -2018-08-02,7575.93,7652.91,7652.91,7549.34,1040000000,-1.01 -2018-08-01,7652.91,7748.76,7751.10,7634.66,1010000000,-1.24 -2018-07-31,7748.76,7700.85,7782.90,7695.76,943370000,0.62 -2018-07-30,7700.85,7701.31,7718.06,7659.91,755660000,-0.01 -2018-07-27,7701.31,7663.17,7717.22,7663.16,788380000,0.50 -2018-07-26,7663.17,7658.26,7684.72,7640.94,607060000,0.06 -2018-07-25,7658.26,7709.05,7710.25,7640.59,698480000,-0.66 -2018-07-24,7709.05,7655.79,7740.64,7648.59,878890000,0.70 -2018-07-23,7655.79,7678.79,7678.79,7621.75,591250000,-0.30 -2018-07-20,7678.79,7683.97,7705.80,7631.66,706250000,-0.07 -2018-07-19,7683.97,7676.28,7702.85,7660.02,716900000,0.10 -2018-07-18,7676.28,7626.33,7685.68,7625.75,671520000,0.65 -2018-07-17,7626.33,7600.45,7641.10,7581.83,746770000,0.34 -2018-07-16,7600.45,7661.87,7667.71,7564.96,608960000,-0.80 -2018-07-13,7661.87,7651.33,7716.24,7651.33,592170000,0.14 -2018-07-12,7651.33,7591.96,7662.96,7591.96,769260000,0.78 -2018-07-11,7591.96,7692.04,7692.04,7578.18,816820000,-1.30 -2018-07-10,7692.04,7687.99,7715.07,7677.06,723210000,0.05 -2018-07-09,7687.99,7617.70,7697.46,7617.70,697510000,0.92 -2018-07-06,7617.70,7603.22,7631.19,7569.70,684000000,0.19 -2018-07-05,7603.22,7573.09,7624.82,7572.69,631120000,0.40 -2018-07-04,7573.09,7593.29,7593.29,7560.81,591920000,-0.27 -2018-07-03,7593.29,7547.85,7632.12,7544.98,1050000000,0.60 -2018-07-02,7547.85,7636.93,7636.93,7540.71,802390000,-1.17 -2018-06-29,7636.93,7615.63,7706.64,7615.63,926730000,0.28 -2018-06-28,7615.63,7621.69,7632.17,7576.01,815210000,-0.08 -2018-06-27,7621.69,7537.92,7633.92,7512.03,1690000000,1.11 -2018-06-26,7537.92,7509.84,7564.05,7509.84,1120000000,0.37 -2018-06-25,7509.84,7682.27,7682.27,7508.32,815820000,-2.24 -2018-06-22,7682.27,7556.44,7689.44,7556.20,738420000,1.67 -2018-06-21,7556.44,7627.40,7670.78,7548.12,801610000,-0.93 -2018-06-20,7627.40,7603.85,7705.20,7603.85,870100000,0.31 -2018-06-19,7603.85,7631.33,7631.33,7548.84,921290000,-0.36 -2018-06-18,7631.33,7633.91,7645.47,7601.60,683910000,-0.03 -2018-06-15,7633.91,7765.79,7781.00,7633.91,1760000000,-1.70 -2018-06-14,7765.79,7703.71,7793.45,7650.16,1150000000,0.81 -2018-06-13,7703.71,7703.81,7746.70,7677.17,877980000,0.00 -2018-06-12,7703.81,7737.43,7762.77,7701.33,797690000,-0.43 -2018-06-11,7737.43,7681.07,7756.02,7681.07,758830000,0.73 -2018-06-08,7681.07,7704.40,7714.32,7637.52,778850000,-0.30 -2018-06-07,7704.40,7712.37,7756.66,7698.15,1090000000,-0.10 -2018-06-06,7712.37,7686.80,7730.48,7671.62,909670000,0.33 -2018-06-05,7686.80,7741.29,7744.46,7686.61,962540000,-0.70 -2018-06-04,7741.29,7701.77,7772.12,7701.70,743520000,0.51 -2018-06-01,7701.77,7678.20,7746.73,7678.20,807700000,0.31 -2018-05-31,7678.20,7689.57,7727.45,7651.12,1590000000,-0.15 -2018-05-30,7689.57,7632.64,7689.57,7618.12,950540000,0.75 -2018-05-29,7632.64,7730.28,7730.28,7610.66,1330000000,-1.26 -2018-05-25,7730.28,7716.74,7753.32,7703.26,852470000,0.18 -2018-05-24,7716.74,7788.44,7803.45,7716.74,917820000,-0.92 -2018-05-23,7788.44,7877.45,7877.45,7765.32,944430000,-1.13 -2018-05-22,7877.45,7859.17,7903.50,7854.58,829870000,0.23 -2018-05-21,7859.17,7778.79,7868.12,7778.12,713100000,1.03 -2018-05-18,7778.79,7787.97,7791.41,7753.27,927550000,-0.12 -2018-05-17,7787.97,7734.20,7788.23,7713.85,802620000,0.70 -2018-05-16,7734.20,7722.98,7745.53,7717.76,959900000,0.15 -2018-05-15,7722.98,7710.98,7752.02,7687.49,1060000000,0.16 -2018-05-14,7710.98,7724.55,7727.96,7688.57,772860000,-0.18 -2018-05-11,7724.55,7700.97,7728.89,7691.69,754160000,0.31 -2018-05-10,7700.97,7662.52,7706.87,7631.58,901480000,0.50 -2018-05-09,7662.52,7565.75,7662.52,7565.75,918680000,1.28 -2018-05-08,7565.75,7567.14,7598.51,7550.44,896880000,-0.02 -2018-05-04,7567.14,7502.69,7570.22,7502.69,886340000,0.86 -2018-05-03,7502.69,7543.20,7555.18,7492.39,745260000,-0.54 -2018-05-02,7543.20,7520.36,7572.98,7519.62,855110000,0.30 -2018-05-01,7520.36,7509.30,7549.07,7506.57,584610000,0.15 -2018-04-30,7509.30,7502.21,7546.16,7497.11,1020000000,0.09 -2018-04-27,7502.21,7421.43,7507.12,7421.28,773110000,1.09 -2018-04-26,7421.43,7379.32,7421.43,7355.00,839860000,0.57 -2018-04-25,7379.32,7425.40,7427.13,7334.64,906770000,-0.62 -2018-04-24,7425.40,7398.87,7439.58,7397.29,862030000,0.36 -2018-04-23,7398.87,7368.17,7404.11,7359.73,799460000,0.42 -2018-04-20,7368.17,7328.92,7368.17,7323.31,792270000,0.54 -2018-04-19,7328.92,7317.34,7340.73,7309.42,811860000,0.16 -2018-04-18,7317.34,7226.05,7325.59,7226.05,904180000,1.26 -2018-04-17,7226.05,7198.20,7240.41,7189.85,735880000,0.39 -2018-04-16,7198.20,7264.56,7265.83,7195.46,889300000,-0.91 -2018-04-13,7264.56,7258.34,7274.99,7249.07,677120000,0.09 -2018-04-12,7258.34,7257.14,7266.64,7240.76,687150000,0.02 -2018-04-11,7257.14,7266.75,7270.28,7243.32,789650000,-0.13 -2018-04-10,7266.75,7194.75,7266.75,7194.75,778170000,1.00 -2018-04-09,7194.75,7183.64,7209.68,7145.57,691580000,0.15 -2018-04-06,7183.64,7199.50,7214.02,7163.11,676290000,-0.22 -2018-04-05,7199.50,7034.01,7199.50,7034.01,819220000,2.35 -2018-04-04,7034.01,7030.46,7046.26,6971.75,818650000,0.05 -2018-04-03,7030.46,7056.61,7064.98,6996.76,814720000,-0.37 -2018-03-29,7056.61,7044.74,7109.93,7042.73,900250000,0.17 -2018-03-28,7044.74,7000.14,7044.74,6923.33,785930000,0.64 -2018-03-27,7000.14,6888.69,7042.37,6888.69,712080000,1.62 -2018-03-26,6888.69,6921.94,6958.47,6866.94,788730000,-0.48 -2018-03-23,6921.94,6952.59,6952.82,6876.96,906200000,-0.44 -2018-03-22,6952.59,7038.97,7038.97,6914.45,887620000,-1.23 -2018-03-21,7038.97,7061.27,7065.66,7016.79,785550000,-0.32 -2018-03-20,7061.27,7042.93,7081.50,7042.60,764830000,0.26 -2018-03-19,7042.93,7164.14,7164.19,7034.91,750730000,-1.69 -2018-03-16,7164.14,7139.76,7187.27,7131.31,1420000000,0.34 -2018-03-15,7139.76,7132.69,7162.58,7127.08,833050000,0.10 -2018-03-14,7132.69,7138.78,7176.51,7122.76,775440000,-0.09 -2018-03-13,7138.78,7214.76,7224.13,7125.60,790450000,-1.05 -2018-03-12,7214.76,7224.51,7254.87,7198.18,631270000,-0.13 -2018-03-09,7224.51,7203.24,7225.28,7189.74,671260000,0.30 -2018-03-08,7203.24,7157.84,7212.14,7145.70,734710000,0.63 -2018-03-07,7157.84,7146.75,7180.71,7109.56,889060000,0.16 -2018-03-06,7146.75,7115.98,7197.80,7115.60,810450000,0.43 -2018-03-05,7115.98,7069.90,7119.21,7062.13,956920000,0.65 -2018-03-02,7069.90,7175.64,7175.64,7063.42,938590000,-1.47 -2018-03-01,7175.64,7231.91,7231.91,7153.39,886340000,-0.78 -2018-02-28,7231.91,7282.45,7293.36,7231.91,948410000,-0.69 -2018-02-27,7282.45,7289.58,7326.02,7272.87,740360000,-0.10 -2018-02-26,7289.58,7244.41,7312.98,7244.31,603890000,0.62 -2018-02-23,7244.41,7252.39,7262.05,7220.81,695740000,-0.11 -2018-02-22,7252.39,7281.57,7281.57,7187.76,952980000,-0.40 -2018-02-21,7281.57,7246.77,7291.80,7220.55,930800000,0.48 -2018-02-20,7246.77,7247.66,7264.78,7202.14,699560000,-0.01 -2018-02-19,7247.66,7294.70,7306.21,7239.98,520050000,-0.64 -2018-02-16,7294.70,7234.81,7307.97,7234.81,671910000,0.83 -2018-02-15,7234.81,7213.97,7267.96,7206.69,770030000,0.29 -2018-02-14,7213.97,7168.01,7243.15,7145.73,969400000,0.64 -2018-02-13,7168.01,7177.06,7202.99,7165.83,740990000,-0.13 -2018-02-12,7177.06,7092.43,7199.93,7092.43,737670000,1.19 -2018-02-09,7092.43,7170.69,7170.69,7073.03,955730000,-1.09 -2018-02-08,7170.69,7279.42,7279.42,7161.31,1000000000,-1.49 -2018-02-07,7279.42,7141.40,7311.50,7141.40,1060000000,1.93 -2018-02-06,7141.40,7334.98,7334.98,7079.41,1400000000,-2.64 -2018-02-05,7334.98,7443.43,7443.43,7334.79,916490000,-1.46 -2018-02-02,7443.43,7490.39,7494.76,7432.25,898530000,-0.63 -2018-02-01,7490.39,7533.55,7554.73,7476.51,899490000,-0.57 -2018-01-31,7533.55,7587.98,7599.01,7521.77,907200000,-0.72 -2018-01-30,7587.98,7671.53,7671.67,7587.12,823710000,-1.09 -2018-01-29,7671.53,7665.54,7689.15,7663.93,631880000,0.08 -2018-01-26,7665.54,7615.84,7667.40,7615.84,735670000,0.65 -2018-01-25,7615.84,7643.43,7662.35,7608.53,735310000,-0.36 -2018-01-24,7643.43,7731.83,7731.98,7643.43,769850000,-1.14 -2018-01-23,7731.83,7715.44,7745.22,7710.03,765380000,0.21 -2018-01-22,7715.44,7730.79,7739.35,7703.67,752610000,-0.20 -2018-01-19,7730.79,7700.96,7731.82,7694.66,820000000,0.39 -2018-01-18,7700.96,7725.43,7739.54,7683.71,789200000,-0.32 -2018-01-17,7725.43,7755.93,7755.93,7711.11,847950000,-0.39 -2018-01-16,7755.93,7769.14,7791.83,7740.55,849620000,-0.17 -2018-01-15,7769.14,7778.64,7783.61,7763.43,568970000,-0.12 -2018-01-12,7778.64,7762.94,7792.56,7752.63,1170000000,0.20 -2018-01-11,7762.94,7748.51,7768.96,7734.64,1010000000,0.19 -2018-01-10,7748.51,7731.02,7756.11,7716.21,885660000,0.23 -2018-01-09,7731.02,7696.51,7733.12,7696.50,728230000,0.45 -2018-01-08,7696.51,7724.22,7733.39,7691.77,654440000,-0.36 -2018-01-05,7724.22,7695.88,7727.73,7689.81,655710000,0.37 -2018-01-04,7695.88,7671.11,7702.51,7671.11,727690000,0.32 -2018-01-03,7671.11,7648.10,7689.86,7640.53,589340000,0.30 -2018-01-02,7648.10,7687.77,7691.34,7624.14,594070000,-0.52 -2017-12-29,7687.77,7622.88,7697.62,7620.01,298180000,0.85 -2017-12-28,7622.88,7620.68,7633.55,7609.77,321520000,0.03 -2017-12-27,7620.68,7592.66,7632.71,7586.42,472510000,0.37 -2017-12-22,7592.66,7603.98,7614.40,7585.47,251370000,-0.15 -2017-12-21,7603.98,7525.22,7609.69,7517.88,640560000,1.05 -2017-12-20,7525.22,7544.09,7550.60,7511.45,679710000,-0.25 -2017-12-19,7544.09,7537.01,7563.49,7534.08,695720000,0.09 -2017-12-18,7537.01,7490.57,7544.26,7490.57,585560000,0.62 -2017-12-15,7490.57,7448.12,7490.57,7433.78,1220000000,0.57 -2017-12-14,7448.12,7496.51,7496.70,7448.12,924060000,-0.65 -2017-12-13,7496.51,7500.41,7510.77,7492.58,1030000000,-0.05 -2017-12-12,7500.41,7453.48,7501.52,7448.31,1020000000,0.63 -2017-12-11,7453.48,7393.96,7458.40,7393.58,933600000,0.80 -2017-12-08,7393.96,7320.75,7412.21,7314.23,1040000000,1.00 -2017-12-07,7320.75,7348.03,7371.73,7314.60,823880000,-0.37 -2017-12-06,7348.03,7327.50,7369.71,7289.36,692980000,0.28 -2017-12-05,7327.50,7338.97,7373.90,7326.57,903630000,-0.16 -2017-12-04,7338.97,7300.49,7369.65,7300.49,768160000,0.53 -2017-12-01,7300.49,7326.67,7355.43,7288.73,865250000,-0.36 -2017-11-30,7326.67,7393.56,7416.26,7326.67,1380000000,-0.90 -2017-11-29,7393.56,7460.65,7460.65,7386.67,1110000000,-0.90 -2017-11-28,7460.65,7383.90,7469.61,7373.95,946120000,1.04 -2017-11-27,7383.90,7409.64,7438.39,7383.90,656440000,-0.35 -2017-11-24,7409.64,7417.24,7425.19,7389.54,561890000,-0.10 -2017-11-23,7417.24,7419.02,7422.73,7373.31,577460000,-0.02 -2017-11-22,7419.02,7411.34,7460.91,7410.38,859390000,0.10 -2017-11-21,7411.34,7389.46,7422.18,7367.86,753290000,0.30 -2017-11-20,7389.46,7380.68,7397.39,7350.37,738280000,0.12 -2017-11-17,7380.68,7386.94,7406.53,7356.16,731960000,-0.08 -2017-11-16,7386.94,7372.61,7393.28,7368.14,926680000,0.19 -2017-11-15,7372.61,7414.42,7415.09,7357.06,919470000,-0.56 -2017-11-14,7414.42,7415.18,7436.57,7396.92,1180000000,-0.01 -2017-11-13,7415.18,7432.99,7469.30,7402.95,759790000,-0.24 -2017-11-10,7432.99,7484.10,7500.29,7421.73,694700000,-0.68 -2017-11-09,7484.10,7529.72,7532.20,7476.89,860710000,-0.61 -2017-11-08,7529.72,7513.11,7534.49,7504.77,807970000,0.22 -2017-11-07,7513.11,7562.28,7582.85,7507.83,747480000,-0.65 -2017-11-06,7562.28,7560.35,7572.90,7544.20,632910000,0.03 -2017-11-03,7560.35,7555.32,7580.95,7541.91,672310000,0.07 -2017-11-02,7555.32,7487.96,7562.26,7478.88,1030000000,0.90 -2017-11-01,7487.96,7493.08,7532.36,7487.96,1210000000,-0.07 -2017-10-31,7493.08,7487.81,7516.85,7483.97,730560000,0.07 -2017-10-30,7487.81,7505.03,7507.02,7478.41,749410000,-0.23 -2017-10-27,7505.03,7486.50,7520.76,7485.24,870030000,0.25 -2017-10-26,7486.50,7447.21,7488.26,7440.11,1020000000,0.53 -2017-10-25,7447.21,7526.54,7528.46,7437.42,922390000,-1.05 -2017-10-24,7526.54,7524.45,7535.22,7508.50,676610000,0.03 -2017-10-23,7524.45,7523.23,7542.00,7511.77,565830000,0.02 -2017-10-20,7523.23,7523.04,7560.04,7517.07,752950000,0.00 -2017-10-19,7523.04,7542.87,7542.87,7485.42,828890000,-0.26 -2017-10-18,7542.87,7516.17,7555.24,7516.17,645750000,0.36 -2017-10-17,7516.17,7526.97,7550.44,7506.31,1030000000,-0.14 -2017-10-16,7526.97,7535.44,7557.00,7526.73,738060000,-0.11 -2017-10-13,7535.44,7556.24,7556.24,7521.09,686920000,-0.28 -2017-10-12,7556.24,7533.81,7565.11,7526.33,722800000,0.30 -2017-10-11,7533.81,7538.27,7550.17,7519.60,1250000000,-0.06 -2017-10-10,7538.27,7507.89,7543.88,7504.56,821710000,0.40 -2017-10-09,7507.89,7522.87,7523.65,7493.68,695850000,-0.20 -2017-10-06,7522.87,7507.99,7527.72,7507.99,694720000,0.20 -2017-10-05,7507.99,7467.58,7507.99,7464.40,775860000,0.54 -2017-10-04,7467.58,7468.11,7476.33,7456.61,945110000,-0.01 -2017-10-03,7468.11,7438.84,7469.82,7426.67,718750000,0.39 -2017-10-02,7438.84,7372.76,7438.84,7372.73,891030000,0.90 -2017-09-29,7372.76,7322.82,7382.67,7321.64,750780000,0.68 -2017-09-28,7322.82,7313.51,7323.33,7289.75,748360000,0.13 -2017-09-27,7313.51,7285.74,7327.50,7285.74,857130000,0.38 -2017-09-26,7285.74,7301.29,7311.82,7273.32,707670000,-0.21 -2017-09-25,7301.29,7310.64,7312.45,7272.49,601760000,-0.13 -2017-09-22,7310.64,7263.90,7320.28,7242.23,644900000,0.64 -2017-09-21,7263.90,7271.95,7289.16,7260.05,807480000,-0.11 -2017-09-20,7271.95,7275.25,7289.93,7249.58,794230000,-0.05 -2017-09-19,7275.25,7253.28,7285.67,7243.59,797450000,0.30 -2017-09-18,7253.28,7215.47,7257.45,7215.47,734330000,0.52 -2017-09-15,7215.47,7295.39,7295.39,7196.58,1460000000,-1.10 -2017-09-14,7295.39,7379.70,7390.70,7287.73,1260000000,-1.14 -2017-09-13,7379.70,7400.69,7401.30,7336.23,870090000,-0.28 -2017-09-12,7400.69,7413.59,7435.84,7386.98,768760000,-0.17 -2017-09-11,7413.59,7377.60,7434.07,7377.60,633810000,0.49 -2017-09-08,7377.60,7396.98,7396.98,7358.42,619110000,-0.26 -2017-09-07,7396.98,7354.13,7412.68,7348.38,663670000,0.58 -2017-09-06,7354.13,7372.92,7372.92,7322.42,697150000,-0.25 -2017-09-05,7372.92,7411.47,7437.51,7369.58,558080000,-0.52 -2017-09-04,7411.47,7438.50,7438.50,7404.05,398670000,-0.36 -2017-09-01,7438.50,7430.62,7460.52,7430.06,552910000,0.11 -2017-08-31,7430.62,7365.26,7443.68,7365.01,784890000,0.89 -2017-08-30,7365.26,7337.43,7381.33,7337.43,686610000,0.38 -2017-08-29,7337.43,7401.46,7401.62,7289.20,757210000,-0.87 -2017-08-25,7401.46,7407.06,7439.53,7401.46,513070000,-0.08 -2017-08-24,7407.06,7382.65,7437.87,7382.16,756850000,0.33 -2017-08-23,7382.65,7381.74,7394.52,7360.33,611960000,0.01 -2017-08-22,7381.74,7318.88,7387.55,7318.88,676380000,0.86 -2017-08-21,7318.88,7323.98,7331.95,7296.80,552910000,-0.07 -2017-08-18,7323.98,7387.87,7387.87,7302.47,741560000,-0.86 -2017-08-17,7387.87,7433.03,7433.74,7382.16,593940000,-0.61 -2017-08-16,7433.03,7383.85,7444.98,7383.85,586260000,0.67 -2017-08-15,7383.85,7353.89,7399.35,7353.89,510540000,0.41 -2017-08-14,7353.89,7309.96,7377.66,7309.96,553290000,0.60 -2017-08-11,7309.96,7389.94,7389.96,7296.49,767620000,-1.08 -2017-08-10,7389.94,7498.06,7498.06,7376.66,735230000,-1.44 -2017-08-09,7498.06,7542.73,7542.73,7475.83,803930000,-0.59 -2017-08-08,7542.73,7531.94,7551.85,7518.45,615740000,0.14 -2017-08-07,7531.94,7511.71,7533.74,7511.71,632190000,0.27 -2017-08-04,7511.71,7474.77,7519.06,7465.12,776410000,0.49 -2017-08-03,7474.77,7411.43,7484.53,7384.22,819300000,0.85 -2017-08-02,7411.43,7423.66,7434.71,7388.91,731350000,-0.16 -2017-08-01,7423.66,7372.00,7440.14,7372.00,740610000,0.70 -2017-07-31,7372.00,7368.37,7425.52,7367.86,927040000,0.05 -2017-07-28,7368.37,7443.01,7443.01,7339.44,822650000,-1.00 -2017-07-27,7443.01,7452.32,7461.85,7410.85,1010000000,-0.12 -2017-07-26,7452.32,7434.82,7487.05,7434.68,774930000,0.24 -2017-07-25,7434.82,7377.73,7453.74,7377.73,798830000,0.77 -2017-07-24,7377.73,7452.91,7453.22,7357.50,1110000000,-1.01 -2017-07-21,7452.91,7487.87,7515.12,7433.89,722770000,-0.47 -2017-07-20,7487.87,7430.91,7502.73,7430.91,728090000,0.77 -2017-07-19,7430.91,7390.22,7442.84,7379.33,660420000,0.55 -2017-07-18,7390.22,7404.13,7418.53,7357.77,634510000,-0.19 -2017-07-17,7404.13,7378.39,7426.37,7378.30,613970000,0.35 -2017-07-14,7378.39,7413.44,7419.81,7363.77,852440000,-0.47 -2017-07-13,7413.44,7416.93,7428.24,7403.75,970710000,-0.05 -2017-07-12,7416.93,7329.76,7439.08,7329.76,821520000,1.19 -2017-07-11,7329.76,7370.03,7386.88,7304.77,683490000,-0.55 -2017-07-10,7370.03,7350.92,7388.02,7344.31,615600000,0.26 -2017-07-07,7350.92,7337.28,7359.48,7314.69,690330000,0.19 -2017-07-06,7337.28,7367.60,7373.85,7303.46,791240000,-0.41 -2017-07-05,7367.60,7357.23,7386.92,7347.52,952880000,0.14 -2017-07-04,7357.23,7377.09,7383.45,7336.75,600300000,-0.27 -2017-07-03,7377.09,7312.72,7386.11,7312.26,726600000,0.88 -2017-06-30,7312.72,7350.32,7377.38,7302.71,1010000000,-0.51 -2017-06-29,7350.32,7387.80,7451.95,7341.75,959170000,-0.51 -2017-06-28,7387.80,7434.36,7445.31,7381.36,859430000,-0.63 -2017-06-27,7434.36,7446.80,7451.68,7411.36,725030000,-0.17 -2017-06-26,7446.80,7424.13,7480.95,7424.13,714440000,0.31 -2017-06-23,7424.13,7439.29,7441.79,7396.75,627790000,-0.20 -2017-06-22,7439.29,7447.79,7448.48,7398.83,813130000,-0.11 -2017-06-21,7447.79,7472.71,7477.17,7417.45,869740000,-0.33 -2017-06-20,7472.71,7523.81,7561.07,7472.71,1040000000,-0.68 -2017-06-19,7523.81,7463.54,7537.84,7463.54,568210000,0.81 -2017-06-16,7463.54,7419.36,7478.99,7419.36,1950000000,0.60 -2017-06-15,7419.36,7474.40,7474.51,7377.86,1010000000,-0.74 -2017-06-14,7474.40,7500.44,7545.07,7474.40,972220000,-0.35 -2017-06-13,7500.44,7511.87,7540.05,7491.86,782430000,-0.15 -2017-06-12,7511.87,7527.33,7540.53,7483.61,712640000,-0.21 -2017-06-09,7527.33,7449.98,7545.12,7449.73,1110000000,1.04 -2017-06-08,7449.98,7478.62,7489.66,7449.98,893770000,-0.38 -2017-06-07,7478.62,7524.95,7555.62,7476.33,901560000,-0.62 -2017-06-06,7524.95,7525.76,7527.64,7502.83,867650000,-0.01 -2017-06-05,7525.76,7547.63,7562.00,7519.06,624060000,-0.29 -2017-06-02,7547.63,7543.77,7598.99,7539.96,823790000,0.05 -2017-06-01,7543.77,7519.95,7558.63,7518.32,884730000,0.32 -2017-05-31,7519.95,7526.51,7586.45,7519.68,1890000000,-0.09 -2017-05-30,7526.51,7547.63,7547.65,7497.07,760550000,-0.28 -2017-05-26,7547.63,7517.71,7554.21,7514.39,797460000,0.40 -2017-05-25,7517.71,7514.90,7529.74,7497.07,638440000,0.04 -2017-05-24,7514.90,7485.29,7519.58,7475.11,848440000,0.40 -2017-05-23,7485.29,7496.34,7521.94,7485.29,699940000,-0.15 -2017-05-22,7496.34,7470.71,7518.12,7470.71,691510000,0.34 -2017-05-19,7470.71,7436.42,7480.28,7436.42,845280000,0.46 -2017-05-18,7436.42,7503.47,7503.68,7389.26,1010000000,-0.89 -2017-05-17,7503.47,7522.03,7532.95,7478.88,1020000000,-0.25 -2017-05-16,7522.03,7454.37,7533.70,7452.44,1040000000,0.91 -2017-05-15,7454.37,7435.39,7460.20,7434.24,857700000,0.26 -2017-05-12,7435.39,7386.63,7435.39,7381.74,879090000,0.66 -2017-05-11,7386.63,7385.24,7396.19,7369.23,985410000,0.02 -2017-05-10,7385.24,7342.21,7398.58,7331.30,848260000,0.59 -2017-05-09,7342.21,7300.86,7359.61,7300.86,729080000,0.57 -2017-05-08,7300.86,7297.43,7322.32,7285.76,738840000,0.05 -2017-05-05,7297.43,7248.10,7297.43,7222.81,908530000,0.68 -2017-05-04,7248.10,7234.53,7280.70,7226.07,947130000,0.19 -2017-05-03,7234.53,7250.05,7250.05,7218.56,790040000,-0.21 -2017-05-02,7250.05,7203.94,7254.32,7203.94,939010000,0.64 -2017-04-28,7203.94,7237.17,7243.31,7197.28,1180000000,-0.46 -2017-04-27,7237.17,7288.72,7289.38,7224.35,1130000000,-0.71 -2017-04-26,7288.72,7275.64,7302.57,7262.32,887070000,0.18 -2017-04-25,7275.64,7264.68,7290.82,7258.74,861210000,0.15 -2017-04-24,7264.68,7114.55,7273.90,7114.55,1060000000,2.11 -2017-04-21,7114.55,7118.54,7134.53,7104.22,924440000,-0.06 -2017-04-20,7118.54,7114.36,7127.58,7096.83,856400000,0.06 -2017-04-19,7114.36,7147.50,7151.18,7114.36,1050000000,-0.46 -2017-04-18,7147.50,7327.59,7327.59,7147.50,1070000000,-2.46 -2017-04-13,7327.59,7348.99,7348.99,7298.85,738070000,-0.29 -2017-04-12,7348.99,7365.50,7402.42,7348.84,915890000,-0.22 -2017-04-11,7365.50,7348.94,7406.35,7332.59,820610000,0.23 -2017-04-10,7348.94,7349.37,7359.25,7337.01,689470000,-0.01 -2017-04-07,7349.37,7303.20,7349.37,7284.73,804730000,0.63 -2017-04-06,7303.20,7331.68,7331.68,7258.11,912350000,-0.39 -2017-04-05,7331.68,7321.82,7362.59,7321.82,772840000,0.13 -2017-04-04,7321.82,7282.69,7324.60,7282.69,810270000,0.54 -2017-04-03,7282.69,7322.92,7350.30,7280.76,769000000,-0.55 -2017-03-31,7322.92,7369.52,7369.55,7322.92,986610000,-0.63 -2017-03-30,7369.52,7373.72,7384.80,7340.25,784500000,-0.06 -2017-03-29,7373.72,7343.42,7373.72,7313.90,803450000,0.41 -2017-03-28,7343.42,7293.50,7349.59,7285.80,815610000,0.68 -2017-03-27,7293.50,7336.82,7336.82,7255.78,802850000,-0.59 -2017-03-24,7336.82,7340.71,7351.60,7322.86,652710000,-0.05 -2017-03-23,7340.71,7324.72,7346.40,7307.65,807600000,0.22 -2017-03-22,7324.72,7378.34,7378.40,7301.83,932570000,-0.73 -2017-03-21,7378.34,7429.81,7440.85,7360.67,873160000,-0.69 -2017-03-20,7429.81,7424.96,7433.68,7399.97,629940000,0.07 -2017-03-17,7424.96,7415.95,7447.00,7402.64,1560000000,0.12 -2017-03-16,7415.95,7368.64,7444.62,7368.64,1120000000,0.64 -2017-03-15,7368.64,7357.85,7383.33,7357.58,845710000,0.15 -2017-03-14,7357.85,7367.08,7386.17,7339.27,868570000,-0.13 -2017-03-13,7367.08,7343.08,7377.41,7342.02,708550000,0.33 -2017-03-10,7343.08,7314.96,7373.00,7314.96,948170000,0.38 -2017-03-09,7314.96,7334.61,7336.26,7263.62,1080000000,-0.27 -2017-03-08,7334.61,7338.99,7354.47,7315.86,893030000,-0.06 -2017-03-07,7338.99,7350.12,7363.74,7335.27,870640000,-0.15 -2017-03-06,7350.12,7374.26,7374.26,7338.94,758390000,-0.33 -2017-03-03,7374.26,7382.35,7382.36,7353.64,876910000,-0.11 -2017-03-02,7382.35,7382.90,7394.61,7372.68,955780000,-0.01 -2017-03-01,7382.90,7263.44,7383.05,7263.44,1070000000,1.64 -2017-02-28,7263.44,7253.00,7284.20,7246.60,1010000000,0.14 -2017-02-27,7253.00,7243.70,7285.19,7239.66,856820000,0.13 -2017-02-24,7243.70,7271.37,7271.86,7192.45,881800000,-0.38 -2017-02-23,7271.37,7302.25,7310.05,7262.94,1100000000,-0.42 -2017-02-22,7302.25,7274.83,7314.26,7274.71,1180000000,0.38 -2017-02-21,7274.83,7299.86,7318.98,7267.49,924700000,-0.34 -2017-02-20,7299.86,7299.96,7329.56,7283.29,655610000,0.00 -2017-02-17,7299.96,7277.92,7307.14,7253.16,826580000,0.30 -2017-02-16,7277.92,7302.41,7302.41,7260.74,705210000,-0.34 -2017-02-15,7302.41,7268.56,7313.44,7268.56,738320000,0.47 -2017-02-14,7268.56,7278.92,7292.65,7251.81,779700000,-0.14 -2017-02-13,7278.92,7258.75,7298.47,7257.67,665380000,0.28 -2017-02-10,7258.75,7229.50,7274.80,7229.45,902730000,0.40 -2017-02-09,7229.50,7188.82,7238.74,7183.14,805920000,0.57 -2017-02-08,7188.82,7186.22,7195.94,7147.18,963910000,0.04 -2017-02-07,7186.22,7172.15,7227.22,7159.57,793590000,0.20 -2017-02-06,7172.15,7188.30,7208.73,7165.17,633430000,-0.22 -2017-02-03,7188.30,7140.75,7202.37,7133.63,810150000,0.67 -2017-02-02,7140.75,7107.65,7163.94,7093.57,907250000,0.47 -2017-02-01,7107.65,7099.15,7170.24,7099.15,809590000,0.12 -2017-01-31,7099.15,7118.48,7162.53,7099.15,983510000,-0.27 -2017-01-30,7118.48,7184.49,7184.70,7105.67,915510000,-0.92 -2017-01-27,7184.49,7161.49,7184.73,7150.76,903600000,0.32 -2017-01-26,7161.49,7164.43,7184.75,7151.34,933670000,-0.04 -2017-01-25,7164.43,7150.34,7205.68,7150.34,1020000000,0.20 -2017-01-24,7150.34,7151.18,7190.15,7144.44,1100000000,-0.01 -2017-01-23,7151.18,7198.44,7198.44,7131.46,736250000,-0.66 -2017-01-20,7198.44,7208.44,7221.01,7193.73,819060000,-0.14 -2017-01-19,7208.44,7247.61,7249.63,7191.67,771560000,-0.54 -2017-01-18,7247.61,7220.38,7260.47,7218.41,820140000,0.38 -2017-01-17,7220.38,7327.13,7329.27,7220.38,879280000,-1.46 -2017-01-16,7327.13,7337.81,7354.14,7320.47,633740000,-0.15 -2017-01-13,7337.81,7292.37,7338.49,7292.37,836370000,0.62 -2017-01-12,7292.37,7290.49,7302.34,7263.42,857070000,0.03 -2017-01-11,7290.49,7275.47,7328.51,7257.15,905710000,0.21 -2017-01-10,7275.47,7237.77,7284.81,7237.29,961630000,0.52 -2017-01-09,7237.77,7210.05,7243.76,7207.40,725810000,0.38 -2017-01-06,7210.05,7195.31,7210.05,7180.64,715800000,0.20 -2017-01-05,7195.31,7189.74,7211.96,7172.77,792500000,0.08 -2017-01-04,7189.74,7177.89,7189.74,7168.77,765000000,0.17 -2017-01-03,7177.89,7142.83,7205.45,7142.83,820160000,0.49 -2016-12-30,7142.83,7120.26,7142.83,7087.54,326490000,0.32 -2016-12-29,7120.26,7106.08,7120.26,7074.47,395480000,0.20 -2016-12-28,7106.08,7068.17,7109.37,7060.85,470760000,0.54 -2016-12-23,7068.17,7063.68,7071.11,7054.64,191920000,0.06 -2016-12-22,7063.68,7041.42,7063.68,7020.13,483160000,0.32 -2016-12-21,7041.42,7043.96,7056.98,7025.68,618990000,-0.04 -2016-12-20,7043.96,7017.16,7045.22,6992.62,744310000,0.38 -2016-12-19,7017.16,7011.64,7025.74,6986.44,645420000,0.08 -2016-12-16,7011.64,6999.01,7038.43,6990.35,1150000000,0.18 -2016-12-15,6999.01,6949.19,7010.48,6925.88,1100000000,0.72 -2016-12-14,6949.19,6968.57,6970.52,6941.95,1000000000,-0.28 -2016-12-13,6968.57,6890.42,6977.99,6877.52,930150000,1.13 -2016-12-12,6890.42,6954.21,6976.78,6875.43,946230000,-0.92 -2016-12-09,6954.21,6931.55,6962.25,6929.46,827890000,0.33 -2016-12-08,6931.55,6902.23,6937.51,6892.17,1050000000,0.42 -2016-12-07,6902.23,6779.84,6902.23,6779.84,1160000000,1.81 -2016-12-06,6779.84,6746.83,6785.32,6723.05,871540000,0.49 -2016-12-05,6746.83,6730.72,6799.50,6697.65,814970000,0.24 -2016-12-02,6730.72,6752.93,6752.93,6678.74,708450000,-0.33 -2016-12-01,6752.93,6783.79,6789.30,6688.41,966720000,-0.45 -2016-11-30,6783.79,6772.00,6845.74,6765.23,1330000000,0.17 -2016-11-29,6772.00,6799.47,6800.91,6729.36,772230000,-0.40 -2016-11-28,6799.47,6840.75,6840.96,6769.77,709670000,-0.60 -2016-11-25,6840.75,6829.20,6852.14,6818.12,477580000,0.17 -2016-11-24,6829.20,6817.71,6831.23,6790.69,491420000,0.17 -2016-11-23,6817.71,6819.72,6880.74,6779.45,796850000,-0.03 -2016-11-22,6819.72,6777.96,6851.37,6777.96,896750000,0.62 -2016-11-21,6777.96,6775.77,6820.90,6754.16,781740000,0.03 -2016-11-18,6775.77,6794.71,6811.62,6740.34,866730000,-0.28 -2016-11-17,6794.71,6749.72,6798.75,6745.08,826250000,0.67 -2016-11-16,6749.72,6792.74,6810.53,6735.69,877280000,-0.63 -2016-11-15,6792.74,6753.18,6820.52,6753.18,1160000000,0.59 -2016-11-14,6753.18,6730.43,6814.19,6730.43,1050000000,0.34 -2016-11-11,6730.43,6827.98,6849.04,6709.72,1110000000,-1.43 -2016-11-10,6827.98,6911.84,6997.25,6799.05,1740000000,-1.21 -2016-11-09,6911.84,6843.13,6911.84,6696.33,1360000000,1.00 -2016-11-08,6843.13,6806.90,6849.31,6795.06,832260000,0.53 -2016-11-07,6806.90,6693.26,6806.90,6693.26,862190000,1.70 -2016-11-04,6693.26,6790.51,6790.52,6676.56,875840000,-1.43 -2016-11-03,6790.51,6845.42,6873.21,6790.51,1080000000,-0.80 -2016-11-02,6845.42,6917.14,6917.14,6845.42,773900000,-1.04 -2016-11-01,6917.14,6954.22,6993.79,6903.61,780870000,-0.53 -2016-10-31,6954.22,6996.26,6996.26,6945.29,810760000,-0.60 -2016-10-28,6996.26,6986.57,7006.43,6927.21,956620000,0.14 -2016-10-27,6986.57,6958.09,7003.93,6924.05,961780000,0.41 -2016-10-26,6958.09,7017.64,7017.64,6917.77,939840000,-0.85 -2016-10-25,7017.64,6986.40,7067.23,6985.92,861000000,0.45 -2016-10-24,6986.40,7020.47,7067.34,6983.40,677600000,-0.49 -2016-10-21,7020.47,7026.90,7058.39,7011.09,757850000,-0.09 -2016-10-20,7026.90,7021.92,7047.55,6998.84,843640000,0.07 -2016-10-19,7021.92,7000.06,7031.20,6975.92,823090000,0.31 -2016-10-18,7000.06,6947.55,7033.02,6946.39,795840000,0.76 -2016-10-17,6947.55,7013.55,7013.55,6937.43,727720000,-0.94 -2016-10-14,7013.55,6977.74,7055.18,6977.74,872170000,0.51 -2016-10-13,6977.74,7024.01,7024.01,6930.04,1040000000,-0.66 -2016-10-12,7024.01,7070.88,7079.42,7015.76,937940000,-0.66 -2016-10-11,7070.88,7097.50,7129.83,7061.36,983130000,-0.38 -2016-10-10,7097.50,7044.39,7104.49,7024.08,874920000,0.75 -2016-10-07,7044.39,6999.96,7079.25,6999.96,1400000000,0.63 -2016-10-06,6999.96,7033.25,7049.34,6999.96,821630000,-0.47 -2016-10-05,7033.25,7074.34,7076.71,7024.13,970160000,-0.58 -2016-10-04,7074.34,6983.52,7121.93,6983.52,1450000000,1.30 -2016-10-03,6983.52,6899.33,6996.43,6898.09,745410000,1.22 -2016-09-30,6899.33,6919.42,6919.42,6809.51,1180000000,-0.29 -2016-09-29,6919.42,6849.38,6941.09,6849.38,859070000,1.02 -2016-09-28,6849.38,6807.67,6878.21,6807.67,758300000,0.61 -2016-09-27,6807.67,6818.04,6865.45,6768.86,847950000,-0.15 -2016-09-26,6818.04,6909.43,6909.63,6806.47,795940000,-1.32 -2016-09-23,6909.43,6911.40,6920.23,6882.62,760910000,-0.03 -2016-09-22,6911.40,6834.77,6937.33,6834.77,756010000,1.12 -2016-09-21,6834.77,6830.79,6879.81,6830.47,722080000,0.06 -2016-09-20,6830.79,6813.55,6869.10,6798.02,715570000,0.25 -2016-09-19,6813.55,6710.28,6813.95,6710.28,706090000,1.54 -2016-09-16,6710.28,6730.30,6746.29,6692.73,1390000000,-0.30 -2016-09-15,6730.30,6673.31,6736.84,6654.82,770120000,0.85 -2016-09-14,6673.31,6665.63,6720.29,6665.63,695110000,0.12 -2016-09-13,6665.63,6700.90,6724.74,6665.63,864670000,-0.53 -2016-09-12,6700.90,6776.95,6776.95,6654.48,887970000,-1.12 -2016-09-09,6776.95,6858.70,6862.38,6762.30,792450000,-1.19 -2016-09-08,6858.70,6846.58,6889.64,6819.82,807430000,0.18 -2016-09-07,6846.58,6826.05,6856.12,6814.87,938660000,0.30 -2016-09-06,6826.05,6879.42,6887.92,6818.96,687090000,-0.78 -2016-09-05,6879.42,6894.60,6910.66,6867.08,556660000,-0.22 -2016-09-02,6894.60,6745.97,6928.25,6745.97,1180000000,2.20 -2016-09-01,6745.97,6781.51,6826.22,6723.21,991760000,-0.52 -2016-08-31,6781.51,6820.79,6832.89,6779.54,942420000,-0.58 -2016-08-30,6820.79,6838.05,6851.83,6808.07,741100000,-0.25 -2016-08-26,6838.05,6816.90,6857.29,6798.82,532510000,0.31 -2016-08-25,6816.90,6835.78,6836.22,6779.15,657670000,-0.28 -2016-08-24,6835.78,6868.51,6868.51,6825.22,748050000,-0.48 -2016-08-23,6868.51,6828.54,6885.39,6828.54,722220000,0.59 -2016-08-22,6828.54,6858.95,6884.61,6812.07,616670000,-0.44 -2016-08-19,6858.95,6868.96,6871.48,6840.94,702480000,-0.15 -2016-08-18,6868.96,6859.15,6893.35,6850.61,579270000,0.14 -2016-08-17,6859.15,6893.92,6920.76,6849.90,716290000,-0.50 -2016-08-16,6893.92,6941.19,6941.19,6893.92,643220000,-0.68 -2016-08-15,6941.19,6916.02,6955.34,6907.17,551500000,0.36 -2016-08-12,6916.02,6914.71,6931.04,6896.04,686790000,0.02 -2016-08-11,6914.71,6866.42,6914.71,6812.73,758100000,0.70 -2016-08-10,6866.42,6851.30,6866.42,6820.04,736640000,0.22 -2016-08-09,6851.30,6809.13,6863.10,6807.76,869310000,0.62 -2016-08-08,6809.13,6793.47,6829.47,6781.47,754480000,0.23 -2016-08-05,6793.47,6740.16,6802.41,6738.57,880800000,0.79 -2016-08-04,6740.16,6634.40,6749.67,6615.83,1000000000,1.59 -2016-08-03,6634.40,6645.40,6673.63,6621.42,797080000,-0.17 -2016-08-02,6645.40,6693.95,6694.14,6630.76,822030000,-0.73 -2016-08-01,6693.95,6724.43,6769.41,6678.45,727710000,-0.45 -2016-07-29,6724.43,6721.06,6740.47,6691.13,921700000,0.05 -2016-07-28,6721.06,6750.43,6762.72,6718.90,1200000000,-0.44 -2016-07-27,6750.43,6724.03,6780.05,6723.71,786510000,0.39 -2016-07-26,6724.03,6710.13,6744.80,6708.58,737760000,0.21 -2016-07-25,6710.13,6730.48,6756.13,6691.03,682060000,-0.30 -2016-07-22,6730.48,6699.89,6735.94,6663.72,716110000,0.46 -2016-07-21,6699.89,6728.99,6732.07,6694.52,809670000,-0.43 -2016-07-20,6728.99,6697.37,6736.57,6694.36,767730000,0.47 -2016-07-19,6697.37,6695.42,6711.69,6660.87,634740000,0.03 -2016-07-18,6695.42,6669.24,6715.58,6653.67,878070000,0.39 -2016-07-15,6669.24,6654.47,6669.24,6616.51,839250000,0.22 -2016-07-14,6654.47,6670.40,6743.42,6648.40,924140000,-0.24 -2016-07-13,6670.40,6680.69,6717.17,6654.64,1060000000,-0.15 -2016-07-12,6680.69,6682.86,6703.09,6663.66,1170000000,-0.03 -2016-07-11,6682.86,6590.64,6695.07,6590.64,968340000,1.40 -2016-07-08,6590.64,6533.79,6605.83,6515.24,937840000,0.87 -2016-07-07,6533.79,6463.59,6579.25,6463.59,1050000000,1.09 -2016-07-06,6463.59,6545.37,6580.32,6432.47,1610000000,-1.25 -2016-07-05,6545.37,6522.26,6561.58,6472.25,1180000000,0.35 -2016-07-04,6522.26,6577.83,6612.13,6514.81,748240000,-0.84 -2016-07-01,6577.83,6504.33,6587.44,6498.56,1100000000,1.13 -2016-06-30,6504.33,6360.06,6504.33,6309.98,1560000000,2.27 -2016-06-29,6360.06,6140.39,6360.06,6140.39,1500000000,3.58 -2016-06-28,6140.39,5982.20,6170.26,5982.20,1590000000,2.64 -2016-06-27,5982.20,6138.69,6138.69,5958.66,2510000000,-2.55 -2016-06-24,6138.69,6338.10,6338.55,5788.74,3880000000,-3.15 -2016-06-23,6338.10,6261.19,6380.58,6261.19,915160000,1.23 -2016-06-22,6261.19,6226.55,6315.62,6222.01,884650000,0.56 -2016-06-21,6226.55,6204.00,6250.19,6156.23,842010000,0.36 -2016-06-20,6204.00,6021.09,6236.53,6021.09,1010000000,3.04 -2016-06-17,6021.09,5950.48,6046.10,5950.48,1310000000,1.19 -2016-06-16,5950.48,5966.80,5966.80,5899.97,815960000,-0.27 -2016-06-15,5966.80,5923.53,6007.49,5923.39,868080000,0.73 -2016-06-14,5923.53,6044.97,6044.97,5921.72,983530000,-2.01 -2016-06-13,6044.97,6115.76,6115.76,6044.97,852840000,-1.16 -2016-06-10,6115.76,6231.89,6231.89,6097.24,748340000,-1.86 -2016-06-09,6231.89,6301.52,6301.73,6229.07,668490000,-1.10 -2016-06-08,6301.52,6284.53,6304.51,6263.80,663110000,0.27 -2016-06-07,6284.53,6273.40,6322.60,6273.40,690000000,0.18 -2016-06-06,6273.40,6209.63,6301.56,6209.63,732580000,1.03 -2016-06-03,6209.63,6185.61,6251.74,6168.19,660720000,0.39 -2016-06-02,6185.61,6191.93,6220.27,6173.05,892210000,-0.10 -2016-06-01,6191.93,6230.79,6233.18,6151.90,887240000,-0.62 -2016-05-31,6230.79,6270.79,6290.07,6230.11,1330000000,-0.64 -2016-05-27,6270.79,6265.65,6275.90,6250.27,577100000,0.08 -2016-05-26,6265.65,6262.85,6281.73,6243.49,665570000,0.04 -2016-05-25,6262.85,6219.26,6270.25,6219.26,870440000,0.70 -2016-05-24,6219.26,6136.43,6231.85,6109.58,833810000,1.35 -2016-05-23,6136.43,6156.32,6173.06,6122.57,653010000,-0.32 -2016-05-20,6156.32,6053.35,6156.50,6053.35,780580000,1.70 -2016-05-19,6053.35,6165.80,6165.80,6050.21,936490000,-1.82 -2016-05-18,6165.80,6167.77,6169.33,6115.99,887530000,-0.03 -2016-05-17,6167.77,6151.40,6215.88,6147.16,758810000,0.27 -2016-05-16,6151.40,6138.50,6157.24,6092.21,445330000,0.21 -2016-05-13,6138.50,6104.19,6138.50,6060.10,646360000,0.56 -2016-05-12,6104.19,6162.49,6193.21,6094.14,698760000,-0.95 -2016-05-11,6162.49,6156.65,6172.72,6131.22,573060000,0.09 -2016-05-10,6156.65,6114.81,6180.19,6114.81,652990000,0.68 -2016-05-09,6114.81,6125.70,6177.60,6108.37,669490000,-0.18 -2016-05-06,6125.70,6117.25,6129.90,6054.74,720350000,0.14 -2016-05-05,6117.25,6112.02,6152.59,6102.29,713230000,0.09 -2016-05-04,6112.02,6185.59,6185.59,6100.76,775560000,-1.19 -2016-05-03,6185.59,6241.89,6270.03,6159.86,895100000,-0.90 -2016-04-29,6241.89,6322.40,6322.40,6241.89,865550000,-1.27 -2016-04-28,6322.40,6319.91,6322.40,6224.47,861760000,0.04 -2016-04-27,6319.91,6284.52,6319.91,6255.20,822360000,0.56 -2016-04-26,6284.52,6260.92,6297.88,6260.92,776830000,0.38 -2016-04-25,6260.92,6310.44,6324.60,6249.34,688680000,-0.78 -2016-04-22,6310.44,6381.44,6381.58,6289.34,675930000,-1.11 -2016-04-21,6381.44,6410.26,6427.32,6352.93,831610000,-0.45 -2016-04-20,6410.26,6405.35,6421.91,6367.36,814750000,0.08 -2016-04-19,6405.35,6353.52,6418.25,6353.49,808480000,0.82 -2016-04-18,6353.52,6343.75,6354.88,6261.71,613390000,0.15 -2016-04-15,6343.75,6365.10,6372.52,6328.19,780840000,-0.34 -2016-04-14,6365.10,6362.89,6373.93,6335.40,853110000,0.03 -2016-04-13,6362.89,6242.39,6362.89,6242.39,957140000,1.93 -2016-04-12,6242.39,6200.12,6248.27,6176.28,690140000,0.68 -2016-04-11,6200.12,6204.41,6229.66,6165.46,552590000,-0.07 -2016-04-08,6204.41,6136.89,6216.28,6136.89,622130000,1.10 -2016-04-07,6136.89,6161.63,6204.11,6119.38,761730000,-0.40 -2016-04-06,6161.63,6091.23,6161.63,6091.23,738660000,1.16 -2016-04-05,6091.23,6164.72,6164.74,6061.85,826020000,-1.19 -2016-04-04,6164.72,6146.05,6201.95,6132.90,546680000,0.30 -2016-04-01,6146.05,6174.90,6174.90,6076.89,747480000,-0.47 -2016-03-31,6174.90,6203.17,6203.39,6149.82,746400000,-0.46 -2016-03-30,6203.17,6105.90,6221.80,6105.90,803810000,1.59 -2016-03-29,6105.90,6106.48,6156.67,6070.77,596330000,-0.01 -2016-03-24,6106.48,6199.11,6199.11,6090.03,625280000,-1.49 -2016-03-23,6199.11,6192.74,6216.76,6171.13,621500000,0.10 -2016-03-22,6192.74,6184.58,6193.47,6110.39,738980000,0.13 -2016-03-21,6184.58,6189.64,6215.30,6154.12,532070000,-0.08 -2016-03-18,6189.64,6201.12,6237.02,6186.24,1130000000,-0.19 -2016-03-17,6201.12,6175.49,6220.02,6125.70,832610000,0.42 -2016-03-16,6175.49,6139.97,6186.18,6134.27,700760000,0.58 -2016-03-15,6139.97,6174.57,6174.57,6114.77,700310000,-0.56 -2016-03-14,6174.57,6139.79,6197.83,6139.79,688590000,0.57 -2016-03-11,6139.79,6036.70,6150.88,6036.70,721700000,1.71 -2016-03-10,6036.70,6146.32,6203.40,6036.70,1060000000,-1.78 -2016-03-09,6146.32,6125.44,6174.82,6118.23,758330000,0.34 -2016-03-08,6125.44,6182.40,6182.45,6101.89,913520000,-0.92 -2016-03-07,6182.40,6199.43,6216.10,6125.64,817960000,-0.27 -2016-03-04,6199.43,6130.46,6204.14,6130.46,866050000,1.13 -2016-03-03,6130.46,6147.06,6173.70,6108.35,902840000,-0.27 -2016-03-02,6147.06,6152.88,6194.01,6097.77,904550000,-0.09 -2016-03-01,6152.88,6097.09,6153.75,6070.51,933630000,0.92 -2016-02-29,6097.09,6096.01,6104.98,6033.21,941710000,0.02 -2016-02-26,6096.01,6012.81,6115.37,6012.81,858940000,1.38 -2016-02-25,6012.81,5867.18,6028.97,5867.18,999960000,2.48 -2016-02-24,5867.18,5962.31,5966.73,5845.55,834680000,-1.60 -2016-02-23,5962.31,6037.73,6037.73,5954.18,747390000,-1.25 -2016-02-22,6037.73,5950.23,6065.81,5950.23,822110000,1.47 -2016-02-19,5950.23,5971.95,6001.22,5916.26,692900000,-0.36 -2016-02-18,5971.95,6030.32,6036.46,5948.25,809870000,-0.97 -2016-02-17,6030.32,5862.17,6030.32,5862.17,948750000,2.87 -2016-02-16,5862.17,5824.28,5880.72,5812.49,771100000,0.65 -2016-02-15,5824.28,5707.60,5844.53,5707.60,724660000,2.04 -2016-02-12,5707.60,5536.97,5707.60,5536.97,1080000000,3.08 -2016-02-11,5536.97,5672.30,5672.30,5499.51,1070000000,-2.39 -2016-02-10,5672.30,5632.19,5712.78,5616.88,994630000,0.71 -2016-02-09,5632.19,5689.36,5739.25,5596.26,1150000000,-1.00 -2016-02-08,5689.36,5848.06,5882.43,5666.13,995840000,-2.71 -2016-02-05,5848.06,5898.76,5945.90,5839.36,983670000,-0.86 -2016-02-04,5898.76,5837.14,5938.12,5831.12,1050000000,1.06 -2016-02-03,5837.14,5922.01,5924.58,5791.04,1030000000,-1.43 -2016-02-02,5922.01,6060.10,6060.45,5889.60,1020000000,-2.28 -2016-02-01,6060.10,6083.79,6115.11,5993.84,833650000,-0.39 -2016-01-29,6083.79,5931.78,6083.79,5931.78,1020000000,2.56 -2016-01-28,5931.78,5990.37,6020.54,5889.37,918480000,-0.98 -2016-01-27,5990.37,5911.46,5990.37,5870.75,902090000,1.33 -2016-01-26,5911.46,5877.00,5919.17,5771.37,878660000,0.59 -2016-01-25,5877.00,5900.01,5933.47,5851.83,828640000,-0.39 -2016-01-22,5900.01,5773.79,5926.94,5773.79,906980000,2.19 -2016-01-21,5773.79,5673.58,5781.24,5659.15,1120000000,1.77 -2016-01-20,5673.58,5876.80,5876.80,5639.88,1070000000,-3.46 -2016-01-19,5876.80,5779.92,5915.69,5779.92,833710000,1.68 -2016-01-18,5779.92,5804.10,5852.09,5766.50,741110000,-0.42 -2016-01-15,5804.10,5918.23,5934.62,5769.23,1120000000,-1.93 -2016-01-14,5918.23,5960.97,5960.97,5829.26,1100000000,-0.72 -2016-01-13,5960.97,5929.24,6011.13,5929.24,834540000,0.54 -2016-01-12,5929.24,5871.83,5985.80,5866.67,831690000,0.98 -2016-01-11,5871.83,5912.44,5941.93,5871.83,841790000,-0.69 -2016-01-08,5912.44,5954.08,6013.38,5912.44,835010000,-0.70 -2016-01-07,5954.08,6073.38,6073.38,5887.97,1090000000,-1.96 -2016-01-06,6073.38,6137.24,6137.24,6018.65,721610000,-1.04 -2016-01-05,6137.24,6093.43,6166.26,6079.23,643370000,0.72 -2016-01-04,6093.43,6242.32,6242.32,6071.01,707340000,-2.39 -2015-12-31,6242.32,6274.05,6278.31,6233.03,166420000,-0.51 -2015-12-30,6274.05,6314.57,6314.57,6261.48,337960000,-0.64 -2015-12-29,6314.57,6254.64,6314.57,6245.24,462310000,0.96 -2015-12-24,6254.64,6240.98,6259.86,6236.85,112220000,0.22 -2015-12-23,6240.98,6083.10,6248.50,6083.10,596530000,2.60 -2015-12-22,6083.10,6034.84,6090.58,6031.82,437450000,0.80 -2015-12-21,6034.84,6052.42,6113.96,6034.84,561860000,-0.29 -2015-12-18,6052.42,6102.54,6105.57,6051.74,1270000000,-0.82 -2015-12-17,6102.54,6061.19,6160.78,6061.19,747550000,0.68 -2015-12-16,6061.19,6017.79,6089.31,6016.25,773630000,0.72 -2015-12-15,6017.79,5874.06,6036.68,5874.06,836320000,2.45 -2015-12-14,5874.06,5952.78,6009.92,5871.88,805170000,-1.32 -2015-12-11,5952.78,6088.05,6088.05,5949.84,830910000,-2.22 -2015-12-10,6088.05,6126.68,6127.09,6079.96,864010000,-0.63 -2015-12-09,6126.68,6135.22,6175.75,6101.22,775110000,-0.14 -2015-12-08,6135.22,6223.52,6224.86,6120.68,814510000,-1.42 -2015-12-07,6223.52,6238.29,6287.23,6215.17,559030000,-0.24 -2015-12-04,6238.29,6275.00,6277.59,6219.50,683050000,-0.59 -2015-12-03,6275.00,6420.93,6444.72,6275.00,817890000,-2.27 -2015-12-02,6420.93,6395.65,6447.34,6395.20,583610000,0.40 -2015-12-01,6395.65,6356.09,6402.36,6356.09,809010000,0.62 -2015-11-30,6356.09,6375.15,6387.11,6329.92,855380000,-0.30 -2015-11-27,6375.15,6393.13,6393.13,6345.30,486350000,-0.28 -2015-11-26,6393.13,6337.64,6395.33,6333.92,467830000,0.88 -2015-11-25,6337.64,6277.23,6348.05,6277.23,694080000,0.96 -2015-11-24,6277.23,6305.49,6305.49,6221.33,880470000,-0.45 -2015-11-23,6305.49,6334.63,6334.63,6267.05,603420000,-0.46 -2015-11-20,6334.63,6329.93,6360.73,6311.76,832320000,0.07 -2015-11-19,6329.93,6278.97,6366.85,6278.97,772700000,0.81 -2015-11-18,6278.97,6268.76,6283.90,6228.15,634120000,0.16 -2015-11-17,6268.76,6146.38,6269.44,6146.38,719060000,1.99 -2015-11-16,6146.38,6118.28,6161.90,6079.79,621590000,0.46 -2015-11-13,6118.28,6178.68,6178.95,6088.76,702650000,-0.98 -2015-11-12,6178.68,6297.20,6300.90,6178.68,852480000,-1.88 -2015-11-11,6297.20,6275.28,6327.16,6272.69,636990000,0.35 -2015-11-10,6275.28,6295.16,6329.69,6250.31,748090000,-0.32 -2015-11-09,6295.16,6353.83,6380.42,6292.05,678630000,-0.92 -2015-11-06,6353.83,6364.90,6395.19,6332.73,733580000,-0.17 -2015-11-05,6364.90,6412.88,6421.81,6358.12,722040000,-0.75 -2015-11-04,6412.88,6383.61,6459.46,6383.04,782760000,0.46 -2015-11-03,6383.61,6361.80,6383.61,6344.70,627800000,0.34 -2015-11-02,6361.80,6361.09,6364.42,6317.29,522270000,0.01 -2015-10-30,6361.09,6395.80,6410.28,6337.65,738500000,-0.54 -2015-10-29,6395.80,6437.80,6437.85,6358.16,852190000,-0.65 -2015-10-28,6437.80,6365.27,6448.46,6355.78,819720000,1.14 -2015-10-27,6365.27,6417.02,6419.62,6365.27,564360000,-0.81 -2015-10-26,6417.02,6444.08,6453.00,6405.38,454680000,-0.42 -2015-10-23,6444.08,6376.28,6487.89,6376.28,749540000,1.06 -2015-10-22,6376.28,6348.42,6387.28,6321.65,740620000,0.44 -2015-10-21,6348.42,6345.13,6387.29,6316.30,615200000,0.05 -2015-10-20,6345.13,6352.33,6367.75,6319.25,592200000,-0.11 -2015-10-19,6352.33,6378.04,6408.09,6336.27,476840000,-0.40 -2015-10-16,6378.04,6338.67,6398.23,6338.67,610630000,0.62 -2015-10-15,6338.67,6269.61,6351.43,6269.61,644980000,1.10 -2015-10-14,6269.61,6342.28,6342.28,6268.29,638450000,-1.15 -2015-10-13,6342.28,6371.18,6371.18,6303.02,722570000,-0.45 -2015-10-12,6371.18,6416.16,6416.16,6351.34,552280000,-0.70 -2015-10-09,6416.16,6374.82,6453.22,6374.82,768200000,0.65 -2015-10-08,6374.82,6336.35,6380.30,6303.46,742310000,0.61 -2015-10-07,6336.35,6326.16,6396.34,6319.77,1020000000,0.16 -2015-10-06,6326.16,6298.92,6343.71,6255.10,737900000,0.43 -2015-10-05,6298.92,6129.98,6301.05,6129.98,890100000,2.76 -2015-10-02,6129.98,6072.47,6176.20,6051.62,888460000,0.95 -2015-10-01,6072.47,6061.61,6172.78,6053.26,873580000,0.18 -2015-09-30,6061.61,5909.24,6061.61,5909.24,1050000000,2.58 -2015-09-29,5909.24,5958.86,5958.86,5877.08,1030000000,-0.83 -2015-09-28,5958.86,6109.01,6110.31,5958.86,997740000,-2.46 -2015-09-25,6109.01,5961.49,6120.67,5961.49,863420000,2.47 -2015-09-24,5961.49,6032.24,6055.64,5947.19,894320000,-1.17 -2015-09-23,6032.24,5935.84,6067.56,5933.23,748150000,1.62 -2015-09-22,5935.84,6108.71,6111.57,5935.84,970780000,-2.83 -2015-09-21,6108.71,6104.11,6168.74,6083.64,719110000,0.08 -2015-09-18,6104.11,6186.99,6188.74,6053.87,1550000000,-1.34 -2015-09-17,6186.99,6229.21,6239.86,6182.63,861350000,-0.68 -2015-09-16,6229.21,6137.60,6244.94,6137.60,844320000,1.49 -2015-09-15,6137.60,6084.59,6158.08,6019.92,728370000,0.87 -2015-09-14,6084.59,6117.76,6191.82,6065.43,617180000,-0.54 -2015-09-11,6117.76,6155.81,6174.28,6113.10,584620000,-0.62 -2015-09-10,6155.81,6229.01,6229.01,6127.52,772720000,-1.18 -2015-09-09,6229.01,6146.10,6284.17,6146.10,756980000,1.35 -2015-09-08,6146.10,6074.52,6196.47,6074.52,685130000,1.18 -2015-09-07,6074.52,6042.92,6125.67,6042.92,479130000,0.52 -2015-09-04,6042.92,6194.10,6194.10,6040.49,766160000,-2.44 -2015-09-03,6194.10,6083.31,6215.74,6083.31,758470000,1.82 -2015-09-02,6083.31,6058.54,6161.68,6021.36,791460000,0.41 -2015-09-01,6058.54,6247.94,6247.94,6028.71,1030000000,-3.03 -2015-08-28,6247.94,6192.03,6247.94,6152.01,895700000,0.90 -2015-08-27,6192.03,5979.20,6212.48,5979.20,1060000000,3.56 -2015-08-26,5979.20,6081.34,6095.05,5949.94,1020000000,-1.68 -2015-08-25,6081.34,5898.87,6115.74,5898.87,1380000000,3.09 -2015-08-24,5898.87,6187.65,6187.65,5768.22,1710000000,-4.67 -2015-08-21,6187.65,6367.89,6367.89,6187.65,832210000,-2.83 -2015-08-20,6367.89,6403.45,6408.61,6359.71,750760000,-0.56 -2015-08-19,6403.45,6526.29,6526.52,6403.45,721080000,-1.88 -2015-08-18,6526.29,6550.30,6564.55,6505.69,555000000,-0.37 -2015-08-17,6550.30,6550.74,6585.88,6507.76,485850000,-0.01 -2015-08-14,6550.74,6568.33,6603.17,6544.42,595480000,-0.27 -2015-08-13,6568.33,6571.19,6634.71,6553.45,689590000,-0.04 -2015-08-12,6571.19,6664.54,6664.54,6536.41,1120000000,-1.40 -2015-08-11,6664.54,6736.22,6736.22,6663.98,727570000,-1.06 -2015-08-10,6736.22,6718.49,6751.49,6653.65,789150000,0.26 -2015-08-07,6718.49,6747.09,6754.77,6718.49,614010000,-0.42 -2015-08-06,6747.09,6752.41,6763.34,6717.49,713000000,-0.08 -2015-08-05,6752.41,6686.57,6764.82,6686.57,873480000,0.98 -2015-08-04,6686.57,6688.62,6715.51,6644.65,1440000000,-0.03 -2015-08-03,6688.62,6696.28,6710.79,6668.18,700910000,-0.11 -2015-07-31,6696.28,6668.87,6705.42,6646.26,958420000,0.41 -2015-07-30,6668.87,6631.00,6697.40,6631.00,802150000,0.57 -2015-07-29,6631.00,6555.28,6634.04,6555.28,845400000,1.16 -2015-07-28,6555.28,6505.13,6569.45,6505.13,730870000,0.77 -2015-07-27,6505.13,6579.81,6589.48,6495.67,686740000,-1.13 -2015-07-24,6579.81,6655.01,6684.81,6573.96,664740000,-1.13 -2015-07-23,6655.01,6667.34,6711.49,6644.85,651240000,-0.18 -2015-07-22,6667.34,6769.07,6769.07,6653.39,714920000,-1.50 -2015-07-21,6769.07,6788.69,6800.13,6758.75,573510000,-0.29 -2015-07-20,6788.69,6775.08,6813.41,6772.09,431750000,0.20 -2015-07-17,6775.08,6796.45,6799.78,6764.80,602280000,-0.31 -2015-07-16,6796.45,6753.75,6805.14,6752.09,605230000,0.63 -2015-07-15,6753.75,6753.75,6775.91,6728.49,566430000,0.00 -2015-07-14,6753.75,6737.95,6753.75,6710.62,595320000,0.23 -2015-07-13,6737.95,6673.38,6743.05,6673.38,661870000,0.97 -2015-07-10,6673.38,6581.63,6687.57,6581.63,720750000,1.39 -2015-07-09,6581.63,6490.70,6594.18,6490.70,788630000,1.40 -2015-07-08,6490.70,6432.21,6515.06,6430.36,941350000,0.91 -2015-07-07,6432.21,6535.68,6543.80,6432.21,789930000,-1.58 -2015-07-06,6535.68,6585.78,6585.78,6506.71,629530000,-0.76 -2015-07-03,6585.78,6630.47,6630.75,6572.46,462880000,-0.67 -2015-07-02,6630.47,6608.59,6647.70,6600.37,608680000,0.33 -2015-07-01,6608.59,6520.98,6637.34,6520.98,814010000,1.34 -2015-06-30,6520.98,6620.48,6620.75,6520.98,909530000,-1.50 -2015-06-29,6620.48,6753.70,6753.70,6598.64,786020000,-1.97 -2015-06-26,6753.70,6807.82,6807.82,6731.13,613760000,-0.79 -2015-06-25,6807.82,6844.80,6869.04,6798.80,675600000,-0.54 -2015-06-24,6844.80,6834.87,6873.43,6834.32,688930000,0.15 -2015-06-23,6834.87,6825.67,6856.49,6825.67,598080000,0.13 -2015-06-22,6825.67,6710.45,6825.67,6710.45,772660000,1.72 -2015-06-19,6710.45,6707.88,6759.29,6691.82,1270000000,0.04 -2015-06-18,6707.88,6680.55,6707.88,6625.16,797210000,0.41 -2015-06-17,6680.55,6710.10,6731.54,6665.95,706470000,-0.44 -2015-06-16,6710.10,6710.52,6723.49,6656.90,740510000,-0.01 -2015-06-15,6710.52,6784.92,6784.92,6708.50,574230000,-1.10 -2015-06-12,6784.92,6846.74,6846.74,6760.06,610750000,-0.90 -2015-06-11,6846.74,6830.27,6870.19,6807.29,699560000,0.24 -2015-06-10,6830.27,6753.80,6843.57,6734.15,843900000,1.13 -2015-06-09,6753.80,6790.04,6803.75,6736.88,702830000,-0.53 -2015-06-08,6790.04,6804.60,6827.16,6781.66,555750000,-0.21 -2015-06-05,6804.60,6859.24,6859.24,6785.15,777840000,-0.80 -2015-06-04,6859.24,6950.46,6950.46,6838.95,807840000,-1.31 -2015-06-03,6950.46,6928.27,6985.69,6901.79,722280000,0.32 -2015-06-02,6928.27,6953.58,6972.25,6872.12,891350000,-0.36 -2015-06-01,6953.58,6984.43,7037.58,6942.66,715730000,-0.44 -2015-05-29,6984.43,7040.92,7069.93,6967.92,1210000000,-0.80 -2015-05-28,7040.92,7033.33,7049.62,7005.88,625450000,0.11 -2015-05-27,7033.33,6948.99,7054.14,6948.62,668800000,1.21 -2015-05-26,6948.99,7031.72,7039.55,6930.28,692150000,-1.18 -2015-05-22,7031.72,7013.47,7061.66,7013.47,641040000,0.26 -2015-05-21,7013.47,7007.26,7026.01,6994.26,582840000,0.09 -2015-05-20,7007.26,6995.10,7018.70,6962.06,850670000,0.17 -2015-05-19,6995.10,6968.87,7011.35,6968.87,801430000,0.38 -2015-05-18,6968.87,6960.49,7015.49,6931.64,633210000,0.12 -2015-05-15,6960.49,6973.04,7009.41,6937.12,723610000,-0.18 -2015-05-14,6973.04,6949.63,6977.93,6884.63,622170000,0.34 -2015-05-13,6949.63,6933.80,6989.91,6920.65,820350000,0.23 -2015-05-12,6933.80,7029.85,7029.85,6887.52,865970000,-1.37 -2015-05-11,7029.85,7046.82,7083.72,7025.17,816710000,-0.24 -2015-05-08,7046.82,6886.95,7046.82,6885.79,1430000000,2.32 -2015-05-07,6886.95,6933.74,6933.74,6810.05,973560000,-0.67 -2015-05-06,6933.74,6927.58,6974.82,6913.46,910980000,0.09 -2015-05-05,6927.58,6985.95,7053.18,6927.58,1050000000,-0.84 -2015-05-01,6985.95,6960.63,6995.41,6919.39,863400000,0.36 -2015-04-30,6960.63,6946.28,6970.34,6906.24,934300000,0.21 -2015-04-29,6946.28,7030.53,7058.19,6945.56,791050000,-1.20 -2015-04-28,7030.53,7103.98,7103.99,6983.97,821000000,-1.03 -2015-04-27,7103.98,7070.70,7122.74,7025.27,700790000,0.47 -2015-04-24,7070.70,7053.67,7102.59,7051.17,821320000,0.24 -2015-04-23,7053.67,7028.24,7055.15,6995.79,736400000,0.36 -2015-04-22,7028.24,7062.93,7092.34,6997.15,809070000,-0.49 -2015-04-21,7062.93,7052.13,7105.13,7030.00,676070000,0.15 -2015-04-20,7052.13,6994.63,7067.84,6994.63,601950000,0.82 -2015-04-17,6994.63,7060.45,7093.52,6979.32,800540000,-0.93 -2015-04-16,7060.45,7096.78,7119.35,7057.74,773860000,-0.51 -2015-04-15,7096.78,7075.26,7111.72,7058.34,744940000,0.30 -2015-04-14,7075.26,7064.30,7086.06,7044.60,690650000,0.16 -2015-04-13,7064.30,7089.77,7089.84,7046.68,610970000,-0.36 -2015-04-10,7089.77,7015.36,7095.36,7015.36,826730000,1.06 -2015-04-09,7015.36,6937.41,7016.99,6937.41,720210000,1.12 -2015-04-08,6937.41,6961.77,7012.06,6931.59,892290000,-0.35 -2015-04-07,6961.77,6833.46,6967.69,6833.46,725880000,1.88 -2015-04-02,6833.46,6809.50,6849.91,6801.27,593710000,0.35 -2015-04-01,6809.50,6773.04,6856.43,6765.40,809440000,0.54 -2015-03-31,6773.04,6891.43,6910.07,6765.05,928180000,-1.72 -2015-03-30,6891.43,6855.02,6914.60,6855.02,659070000,0.53 -2015-03-27,6855.02,6895.33,6910.55,6839.88,759280000,-0.58 -2015-03-26,6895.33,6990.97,6990.97,6876.84,965480000,-1.37 -2015-03-25,6990.97,7019.68,7035.11,6983.94,665750000,-0.41 -2015-03-24,7019.68,7037.67,7065.08,7012.51,722190000,-0.26 -2015-03-23,7037.67,7022.51,7037.67,6991.43,694420000,0.22 -2015-03-20,7022.51,6962.32,7024.21,6960.81,1460000000,0.86 -2015-03-19,6962.32,6945.20,6982.79,6929.73,834200000,0.25 -2015-03-18,6945.20,6837.61,6945.20,6837.26,796530000,1.57 -2015-03-17,6837.61,6804.08,6846.90,6798.47,780790000,0.49 -2015-03-16,6804.08,6740.58,6809.08,6740.58,706940000,0.94 -2015-03-13,6740.58,6761.07,6777.77,6713.50,732040000,-0.30 -2015-03-12,6761.07,6721.51,6799.84,6721.51,872090000,0.59 -2015-03-11,6721.51,6702.84,6738.95,6693.80,769930000,0.28 -2015-03-10,6702.84,6876.47,6876.86,6702.84,914710000,-2.52 -2015-03-09,6876.47,6911.80,6911.80,6859.81,691320000,-0.51 -2015-03-06,6911.80,6961.14,6961.23,6911.80,771790000,-0.71 -2015-03-05,6961.14,6919.24,6968.64,6914.06,823100000,0.61 -2015-03-04,6919.24,6889.13,6919.24,6862.87,764090000,0.44 -2015-03-03,6889.13,6940.64,6963.55,6889.13,808290000,-0.74 -2015-03-02,6940.64,6946.66,6974.26,6924.33,802780000,-0.09 -2015-02-27,6946.66,6949.73,6967.24,6929.84,908710000,-0.04 -2015-02-26,6949.73,6935.38,6949.98,6920.54,806280000,0.21 -2015-02-25,6935.38,6949.63,6955.41,6904.88,718030000,-0.21 -2015-02-24,6949.63,6912.16,6958.89,6899.59,857360000,0.54 -2015-02-23,6912.16,6915.20,6943.61,6885.89,700280000,-0.04 -2015-02-20,6915.20,6888.90,6920.51,6884.77,787660000,0.38 -2015-02-19,6888.90,6898.08,6907.30,6858.67,661610000,-0.13 -2015-02-18,6898.08,6898.13,6921.32,6876.30,698360000,0.00 -2015-02-17,6898.13,6857.05,6898.13,6819.78,631890000,0.60 -2015-02-16,6857.05,6873.52,6878.66,6851.77,428640000,-0.24 -2015-02-13,6873.52,6828.11,6887.57,6828.11,757580000,0.67 -2015-02-12,6828.11,6818.17,6854.62,6817.23,834910000,0.15 -2015-02-11,6818.17,6829.12,6838.33,6786.12,641790000,-0.16 -2015-02-10,6829.12,6837.15,6843.90,6788.89,795910000,-0.12 -2015-02-09,6837.15,6853.44,6853.44,6777.99,639890000,-0.24 -2015-02-06,6853.44,6865.93,6886.22,6835.48,668590000,-0.18 -2015-02-05,6865.93,6860.02,6870.10,6808.19,753810000,0.09 -2015-02-04,6860.02,6871.80,6883.49,6804.10,835230000,-0.17 -2015-02-03,6871.80,6782.55,6886.31,6782.39,882170000,1.32 -2015-02-02,6782.55,6749.40,6795.52,6731.99,780980000,0.49 -2015-01-30,6749.40,6810.60,6843.98,6749.40,823480000,-0.90 -2015-01-29,6810.60,6825.94,6825.94,6750.22,726310000,-0.22 -2015-01-28,6825.94,6811.61,6863.00,6777.08,803720000,0.21 -2015-01-27,6811.61,6852.40,6864.97,6773.54,735990000,-0.60 -2015-01-26,6852.40,6832.83,6855.92,6790.13,630840000,0.29 -2015-01-23,6832.83,6796.63,6841.73,6796.58,863800000,0.53 -2015-01-22,6796.63,6728.04,6808.18,6726.24,954660000,1.02 -2015-01-21,6728.04,6620.10,6728.04,6620.10,873750000,1.63 -2015-01-20,6620.10,6585.53,6640.44,6585.53,697940000,0.52 -2015-01-19,6585.53,6550.27,6598.89,6548.00,554550000,0.54 -2015-01-16,6550.27,6498.78,6553.20,6443.28,830660000,0.79 -2015-01-15,6498.78,6388.46,6498.78,6298.15,1010000000,1.73 -2015-01-14,6388.46,6542.20,6542.20,6353.65,1000000000,-2.35 -2015-01-13,6542.20,6501.42,6558.83,6465.19,694410000,0.63 -2015-01-12,6501.42,6501.14,6542.43,6447.91,620940000,0.00 -2015-01-09,6501.14,6569.96,6570.24,6471.38,761330000,-1.05 -2015-01-08,6569.96,6419.83,6580.82,6419.83,910040000,2.34 -2015-01-07,6419.83,6366.51,6459.74,6366.51,709500000,0.84 -2015-01-06,6366.51,6417.16,6452.66,6328.59,793260000,-0.79 -2015-01-05,6417.16,6547.80,6576.74,6404.49,750520000,-2.00 -2015-01-02,6547.80,6566.09,6607.89,6510.60,378930000,-0.28 -2014-12-31,6566.09,6547.00,6578.24,6547.00,129450000,0.29 -2014-12-30,6547.00,6633.51,6633.51,6528.89,348400000,-1.30 -2014-12-29,6633.51,6609.93,6651.96,6587.87,361180000,0.36 -2014-12-24,6609.93,6598.18,6618.09,6586.05,261330000,0.18 -2014-12-23,6598.18,6576.74,6620.47,6576.74,392040000,0.33 -2014-12-22,6576.74,6545.27,6620.95,6545.27,498580000,0.48 -2014-12-19,6545.27,6466.00,6566.90,6466.00,1180000000,1.23 -2014-12-18,6466.00,6336.48,6466.00,6336.48,967410000,2.04 -2014-12-17,6336.48,6331.83,6359.68,6240.32,745850000,0.07 -2014-12-16,6331.83,6182.72,6331.83,6144.72,1040000000,2.41 -2014-12-15,6182.72,6300.63,6356.34,6182.72,985780000,-1.87 -2014-12-12,6300.63,6461.70,6461.70,6297.44,793970000,-2.49 -2014-12-11,6461.70,6500.04,6521.66,6441.28,757390000,-0.59 -2014-12-10,6500.04,6529.47,6565.77,6500.04,692350000,-0.45 -2014-12-09,6529.47,6672.15,6672.15,6529.47,950810000,-2.14 -2014-12-08,6672.15,6742.84,6742.84,6672.15,513900000,-1.05 -2014-12-05,6742.84,6679.37,6751.32,6679.37,678460000,0.95 -2014-12-04,6679.37,6716.63,6733.96,6672.67,699900000,-0.55 -2014-12-03,6716.63,6742.10,6753.19,6713.81,706050000,-0.38 -2014-12-02,6742.10,6656.37,6744.31,6656.37,654950000,1.29 -2014-12-01,6656.37,6722.62,6722.62,6637.39,726570000,-0.99 -2014-11-28,6722.62,6723.42,6734.71,6667.08,839390000,-0.01 -2014-11-27,6723.42,6729.17,6749.91,6713.76,517210000,-0.09 -2014-11-26,6729.17,6731.14,6765.01,6718.53,586890000,-0.03 -2014-11-25,6731.14,6729.79,6750.87,6709.31,907290000,0.02 -2014-11-24,6729.79,6750.76,6763.97,6720.09,675410000,-0.31 -2014-11-21,6750.76,6678.90,6773.14,6678.90,845580000,1.08 -2014-11-20,6678.90,6696.60,6696.82,6641.14,640500000,-0.26 -2014-11-19,6696.60,6709.13,6718.88,6678.13,802690000,-0.19 -2014-11-18,6709.13,6671.97,6714.12,6671.75,653230000,0.56 -2014-11-17,6671.97,6654.37,6681.55,6616.12,537370000,0.26 -2014-11-14,6654.37,6635.45,6654.37,6610.13,627540000,0.29 -2014-11-13,6635.45,6611.04,6645.90,6596.89,721390000,0.37 -2014-11-12,6611.04,6627.40,6629.33,6588.93,702770000,-0.25 -2014-11-11,6627.40,6611.25,6632.57,6605.34,764950000,0.24 -2014-11-10,6611.25,6567.24,6611.25,6566.78,575420000,0.67 -2014-11-07,6567.24,6551.15,6608.23,6551.15,764960000,0.25 -2014-11-06,6551.15,6539.14,6580.21,6503.81,799910000,0.18 -2014-11-05,6539.14,6453.97,6539.14,6453.97,769260000,1.32 -2014-11-04,6453.97,6487.97,6510.31,6444.89,816650000,-0.52 -2014-11-03,6487.97,6546.47,6559.56,6478.49,712570000,-0.89 -2014-10-31,6546.47,6463.55,6553.37,6463.55,1060000000,1.28 -2014-10-30,6463.55,6453.87,6483.24,6378.15,815850000,0.15 -2014-10-29,6453.87,6402.17,6475.35,6402.17,700840000,0.81 -2014-10-28,6402.17,6363.46,6412.00,6363.46,800680000,0.61 -2014-10-27,6363.46,6388.73,6443.76,6336.06,781570000,-0.40 -2014-10-24,6388.73,6419.15,6419.15,6372.43,717830000,-0.47 -2014-10-23,6419.15,6399.73,6430.32,6313.32,840400000,0.30 -2014-10-22,6399.73,6372.33,6401.51,6341.39,725610000,0.43 -2014-10-21,6372.33,6267.07,6372.33,6229.40,855940000,1.68 -2014-10-20,6267.07,6310.29,6320.31,6238.60,723300000,-0.68 -2014-10-17,6310.29,6195.91,6312.97,6188.04,1110000000,1.85 -2014-10-16,6195.91,6211.64,6282.95,6072.68,1700000000,-0.25 -2014-10-15,6211.64,6392.68,6404.96,6211.64,1140000000,-2.83 -2014-10-14,6392.68,6366.24,6403.43,6304.27,830850000,0.42 -2014-10-13,6366.24,6339.97,6387.36,6294.64,846370000,0.41 -2014-10-10,6339.97,6431.85,6431.85,6328.39,893110000,-1.43 -2014-10-09,6431.85,6482.24,6544.21,6425.16,864390000,-0.78 -2014-10-08,6482.24,6495.58,6502.36,6453.81,822970000,-0.21 -2014-10-07,6495.58,6563.65,6563.84,6495.58,858000000,-1.04 -2014-10-06,6563.65,6527.91,6588.31,6527.91,722220000,0.55 -2014-10-03,6527.91,6446.39,6542.87,6446.39,750610000,1.26 -2014-10-02,6446.39,6557.52,6557.67,6446.39,805720000,-1.69 -2014-10-01,6557.52,6622.72,6622.81,6539.73,789710000,-0.98 -2014-09-30,6622.72,6646.60,6658.91,6601.62,882270000,-0.36 -2014-09-29,6646.60,6649.39,6653.94,6608.66,564790000,-0.04 -2014-09-26,6649.39,6639.71,6664.00,6615.12,588720000,0.15 -2014-09-25,6639.71,6706.27,6726.40,6621.48,927830000,-0.99 -2014-09-24,6706.27,6676.08,6707.26,6651.98,793650000,0.45 -2014-09-23,6676.08,6773.63,6777.27,6647.21,762690000,-1.44 -2014-09-22,6773.63,6837.92,6838.35,6766.89,674060000,-0.94 -2014-09-19,6837.92,6819.29,6876.00,6819.29,1540000000,0.27 -2014-09-18,6819.29,6780.90,6822.60,6769.58,644480000,0.57 -2014-09-17,6780.90,6792.24,6816.89,6780.90,596030000,-0.17 -2014-09-16,6792.24,6804.21,6804.34,6748.09,592890000,-0.18 -2014-09-15,6804.21,6806.96,6813.87,6771.69,529230000,-0.04 -2014-09-12,6806.96,6799.62,6832.16,6799.39,552970000,0.11 -2014-09-11,6799.62,6830.11,6857.54,6764.86,648020000,-0.45 -2014-09-10,6830.11,6829.00,6847.79,6800.04,585610000,0.02 -2014-09-09,6829.00,6834.77,6846.18,6812.50,580800000,-0.08 -2014-09-08,6834.77,6855.10,6855.10,6773.78,752270000,-0.30 -2014-09-05,6855.10,6877.97,6884.96,6829.10,596550000,-0.33 -2014-09-04,6877.97,6873.58,6904.86,6866.25,688900000,0.06 -2014-09-03,6873.58,6829.17,6898.62,6826.73,674900000,0.65 -2014-09-02,6829.17,6825.31,6849.28,6812.31,820230000,0.06 -2014-09-01,6825.31,6819.75,6825.31,6798.33,404270000,0.08 -2014-08-29,6819.75,6805.80,6828.92,6782.63,720980000,0.20 -2014-08-28,6805.80,6830.66,6831.19,6796.86,498070000,-0.36 -2014-08-27,6830.66,6822.76,6830.66,6813.24,481230000,0.12 -2014-08-26,6822.76,6775.25,6827.32,6775.25,538320000,0.70 -2014-08-22,6775.25,6777.66,6784.63,6746.37,571520000,-0.04 -2014-08-21,6777.66,6755.48,6780.73,6752.70,423430000,0.33 -2014-08-20,6755.48,6779.31,6781.23,6739.76,466210000,-0.35 -2014-08-19,6779.31,6741.25,6782.90,6740.65,459710000,0.56 -2014-08-18,6741.25,6689.08,6745.72,6689.08,413050000,0.78 -2014-08-15,6689.08,6685.26,6742.82,6685.25,545280000,0.06 -2014-08-14,6685.26,6656.68,6694.64,6641.81,512930000,0.43 -2014-08-13,6656.68,6632.42,6664.34,6625.98,527730000,0.37 -2014-08-12,6632.42,6632.82,6643.70,6612.52,448280000,-0.01 -2014-08-11,6632.82,6567.36,6645.83,6567.36,494370000,1.00 -2014-08-08,6567.36,6597.37,6597.37,6528.73,645420000,-0.45 -2014-08-07,6597.37,6636.16,6649.05,6589.78,565630000,-0.58 -2014-08-06,6636.16,6682.48,6682.48,6588.43,803800000,-0.69 -2014-08-05,6682.48,6677.52,6713.52,6671.46,512850000,0.07 -2014-08-04,6677.52,6679.18,6715.56,6669.93,522830000,-0.02 -2014-08-01,6679.18,6730.11,6730.11,6624.72,695020000,-0.76 -2014-07-31,6730.11,6773.44,6797.09,6716.29,919870000,-0.64 -2014-07-30,6773.44,6807.75,6815.29,6758.24,692780000,-0.50 -2014-07-29,6807.75,6788.07,6833.67,6784.04,527060000,0.29 -2014-07-28,6788.07,6791.55,6809.61,6761.77,528420000,-0.05 -2014-07-25,6791.55,6821.46,6830.77,6780.65,661620000,-0.44 -2014-07-24,6821.46,6798.15,6821.46,6767.33,541590000,0.34 -2014-07-23,6798.15,6795.34,6822.65,6773.11,588950000,0.04 -2014-07-22,6795.34,6728.44,6801.84,6728.44,537780000,0.99 -2014-07-21,6728.44,6749.45,6753.42,6715.78,470700000,-0.31 -2014-07-18,6749.45,6738.32,6749.89,6690.90,584830000,0.17 -2014-07-17,6738.32,6784.67,6784.67,6727.71,631290000,-0.68 -2014-07-16,6784.67,6710.45,6792.55,6710.45,610710000,1.11 -2014-07-15,6710.45,6746.14,6764.00,6709.15,604330000,-0.53 -2014-07-14,6746.14,6690.17,6760.73,6690.17,468490000,0.84 -2014-07-11,6690.17,6672.37,6696.10,6663.67,533170000,0.27 -2014-07-10,6672.37,6718.04,6724.80,6643.62,764870000,-0.68 -2014-07-09,6718.04,6738.45,6740.82,6692.77,601510000,-0.30 -2014-07-08,6738.45,6823.51,6831.02,6738.45,660680000,-1.25 -2014-07-07,6823.51,6866.05,6866.37,6817.60,387940000,-0.62 -2014-07-04,6866.05,6865.21,6875.31,6856.35,329360000,0.01 -2014-07-03,6865.21,6816.37,6866.56,6815.45,523960000,0.72 -2014-07-02,6816.37,6802.92,6829.49,6796.61,479500000,0.20 -2014-07-01,6802.92,6743.94,6805.90,6743.94,513050000,0.87 -2014-06-30,6743.94,6757.77,6777.11,6730.45,614340000,-0.20 -2014-06-27,6757.77,6735.12,6767.63,6735.12,516990000,0.34 -2014-06-26,6735.12,6733.62,6753.25,6701.59,902550000,0.02 -2014-06-25,6733.62,6787.07,6787.07,6716.35,585450000,-0.79 -2014-06-24,6787.07,6800.56,6824.45,6776.80,570130000,-0.20 -2014-06-23,6800.56,6825.20,6829.76,6785.83,466640000,-0.36 -2014-06-20,6825.20,6808.11,6840.62,6791.20,1020000000,0.25 -2014-06-19,6808.11,6778.56,6837.57,6778.56,563400000,0.44 -2014-06-18,6778.56,6766.77,6799.59,6766.77,511300000,0.17 -2014-06-17,6766.77,6754.64,6774.87,6736.11,572510000,0.18 -2014-06-16,6754.64,6777.85,6779.40,6748.04,568440000,-0.34 -2014-06-13,6777.85,6843.11,6843.11,6758.15,640610000,-0.95 -2014-06-12,6843.11,6838.87,6853.18,6827.03,527380000,0.06 -2014-06-11,6838.87,6873.55,6873.55,6825.24,675330000,-0.50 -2014-06-10,6873.55,6875.00,6875.24,6835.80,534390000,-0.02 -2014-06-09,6875.00,6858.21,6878.96,6857.70,388130000,0.24 -2014-06-06,6858.21,6813.49,6862.91,6813.49,766310000,0.66 -2014-06-05,6813.49,6818.63,6847.00,6795.27,626570000,-0.08 -2014-06-04,6818.63,6836.30,6840.60,6800.10,560720000,-0.26 -2014-06-03,6836.30,6864.10,6865.38,6817.96,504990000,-0.41 -2014-06-02,6864.10,6844.51,6874.38,6844.51,573720000,0.29 -2014-05-30,6844.51,6871.29,6874.33,6831.99,1170000000,-0.39 -2014-05-29,6871.29,6851.22,6882.14,6848.06,403370000,0.29 -2014-05-28,6851.22,6844.94,6855.83,6833.61,577490000,0.09 -2014-05-27,6844.94,6815.75,6857.10,6815.37,585490000,0.43 -2014-05-23,6815.75,6820.56,6825.53,6793.47,485850000,-0.07 -2014-05-22,6820.56,6821.04,6846.57,6810.19,564130000,-0.01 -2014-05-21,6821.04,6802.00,6821.04,6782.80,733750000,0.28 -2014-05-20,6802.00,6844.55,6848.36,6792.51,680770000,-0.62 -2014-05-19,6844.55,6855.81,6862.20,6804.31,744480000,-0.16 -2014-05-16,6855.81,6840.89,6855.94,6813.50,985980000,0.22 -2014-05-15,6840.89,6878.49,6894.88,6821.66,896970000,-0.55 -2014-05-14,6878.49,6873.08,6880.07,6854.02,529680000,0.08 -2014-05-13,6873.08,6851.75,6877.39,6845.95,631550000,0.31 -2014-05-12,6851.75,6814.57,6851.75,6814.57,565080000,0.55 -2014-05-09,6814.57,6839.25,6839.42,6805.39,617680000,-0.36 -2014-05-08,6839.25,6796.44,6840.37,6796.44,818480000,0.63 -2014-05-07,6796.44,6798.56,6799.34,6766.84,768890000,-0.03 -2014-05-06,6798.56,6822.42,6828.62,6785.32,732620000,-0.35 -2014-05-02,6822.42,6808.87,6838.17,6798.61,746450000,0.20 -2014-05-01,6808.87,6780.03,6811.64,6773.69,648190000,0.43 -2014-04-30,6780.03,6769.91,6794.88,6748.76,773110000,0.15 -2014-04-29,6769.91,6700.16,6769.91,6700.10,674490000,1.04 -2014-04-28,6700.16,6685.69,6720.33,6682.90,652390000,0.22 -2014-04-25,6685.69,6702.85,6704.37,6657.30,578700000,-0.26 -2014-04-24,6703.00,6674.74,6724.58,6667.65,616110000,0.42 -2014-04-23,6674.74,6681.76,6694.82,6661.42,637850000,-0.11 -2014-04-22,6681.76,6625.25,6706.19,6625.25,840730000,0.85 -2014-04-17,6625.25,6584.17,6627.25,6559.35,842350000,0.62 -2014-04-16,6584.17,6541.61,6596.99,6541.61,686340000,0.65 -2014-04-15,6541.61,6583.76,6594.24,6534.20,858940000,-0.64 -2014-04-14,6583.76,6561.70,6583.76,6507.08,979650000,0.34 -2014-04-11,6561.70,6641.97,6641.97,6538.75,817950000,-1.21 -2014-04-10,6641.97,6635.61,6688.28,6620.39,670600000,0.10 -2014-04-09,6635.61,6590.69,6654.05,6590.41,758990000,0.68 -2014-04-08,6590.69,6622.84,6625.19,6549.75,1060000000,-0.49 -2014-04-07,6622.84,6695.55,6695.55,6614.73,666070000,-1.09 -2014-04-04,6695.55,6649.14,6706.34,6649.14,876230000,0.70 -2014-04-03,6649.14,6659.04,6680.78,6638.52,670680000,-0.15 -2014-04-02,6659.04,6652.61,6672.73,6639.63,971880000,0.10 -2014-04-01,6652.61,6598.37,6660.27,6598.37,853490000,0.82 -2014-03-31,6598.37,6615.58,6658.40,6583.09,867820000,-0.26 -2014-03-28,6615.58,6588.32,6631.48,6585.73,1000000000,0.41 -2014-03-27,6588.32,6605.30,6605.30,6561.39,850230000,-0.26 -2014-03-26,6605.30,6604.89,6643.58,6601.78,1430000000,0.01 -2014-03-25,6604.89,6520.39,6604.89,6520.39,674290000,1.30 -2014-03-24,6520.39,6557.17,6568.96,6506.42,762850000,-0.56 -2014-03-21,6557.17,6542.44,6572.09,6537.89,1500000000,0.23 -2014-03-20,6542.44,6573.13,6573.13,6492.62,795070000,-0.47 -2014-03-19,6573.13,6605.28,6609.46,6566.85,1050000000,-0.49 -2014-03-18,6605.28,6568.35,6628.20,6534.86,723560000,0.56 -2014-03-17,6568.35,6527.89,6592.37,6527.87,692710000,0.62 -2014-03-14,6527.89,6553.78,6553.78,6500.37,847300000,-0.40 -2014-03-13,6553.78,6620.90,6631.38,6552.46,894840000,-1.01 -2014-03-12,6620.90,6685.52,6685.52,6598.36,891940000,-0.97 -2014-03-11,6685.52,6689.45,6718.30,6660.59,868650000,-0.06 -2014-03-10,6689.45,6712.67,6757.00,6671.62,820420000,-0.35 -2014-03-07,6712.67,6788.49,6800.66,6706.38,793750000,-1.12 -2014-03-06,6788.49,6775.42,6806.62,6770.95,664690000,0.19 -2014-03-05,6775.42,6823.77,6824.16,6771.50,623860000,-0.71 -2014-03-04,6823.77,6708.35,6827.22,6708.35,734140000,1.72 -2014-03-03,6708.35,6809.70,6809.70,6671.89,829080000,-1.49 -2014-02-28,6809.70,6810.27,6833.82,6785.54,924580000,-0.01 -2014-02-27,6810.27,6799.15,6819.24,6733.54,845700000,0.16 -2014-02-26,6799.15,6830.50,6834.09,6785.28,739000000,-0.46 -2014-02-25,6830.50,6862.73,6866.35,6790.93,1160000000,-0.52 -2014-02-24,6865.86,6838.06,6865.86,6797.83,1070000000,0.41 -2014-02-21,6838.06,6812.99,6859.91,6812.99,1020000000,0.37 -2014-02-20,6812.99,6796.71,6812.99,6732.03,742460000,0.24 -2014-02-19,6796.71,6796.43,6810.48,6759.86,793950000,0.00 -2014-02-18,6796.43,6736.00,6802.89,6716.64,826630000,0.90 -2014-02-17,6736.00,6663.62,6745.63,6661.47,630250000,1.09 -2014-02-14,6663.62,6659.42,6672.21,6646.47,912780000,0.06 -2014-02-13,6659.42,6675.03,6675.24,6608.09,1170000000,-0.23 -2014-02-12,6675.03,6672.66,6708.17,6669.06,820070000,0.04 -2014-02-11,6672.66,6591.55,6672.66,6591.55,934910000,1.23 -2014-02-10,6591.55,6571.68,6597.00,6565.30,593690000,0.30 -2014-02-07,6571.68,6558.28,6596.28,6540.81,708470000,0.20 -2014-02-06,6558.28,6457.89,6566.01,6457.89,815150000,1.55 -2014-02-05,6457.89,6449.27,6483.73,6423.79,810170000,0.13 -2014-02-04,6449.27,6465.66,6478.16,6416.72,922890000,-0.25 -2014-02-03,6465.66,6510.44,6538.30,6459.95,829890000,-0.69 -2014-01-31,6510.44,6538.45,6548.46,6421.26,751200000,-0.43 -2014-01-30,6538.45,6544.28,6573.92,6503.25,755890000,-0.09 -2014-01-29,6544.28,6572.33,6645.23,6482.74,990210000,-0.43 -2014-01-28,6572.33,6550.66,6590.66,6550.65,675700000,0.33 -2014-01-27,6550.66,6663.74,6665.39,6539.33,985290000,-1.70 -2014-01-24,6663.74,6773.28,6784.42,6654.86,844750000,-1.62 -2014-01-23,6773.28,6826.33,6837.21,6760.63,668660000,-0.78 -2014-01-22,6826.33,6834.26,6864.87,6821.80,548740000,-0.12 -2014-01-21,6834.26,6836.73,6867.42,6822.31,618280000,-0.04 -2014-01-20,6836.73,6829.30,6837.53,6810.62,424810000,0.11 -2014-01-17,6829.30,6815.42,6840.50,6800.00,999740000,0.20 -2014-01-16,6815.42,6819.86,6831.74,6811.16,714150000,-0.07 -2014-01-15,6819.86,6766.86,6825.20,6766.86,693720000,0.78 -2014-01-14,6766.86,6757.15,6772.63,6694.08,568350000,0.14 -2014-01-13,6757.15,6739.94,6765.60,6730.97,598030000,0.26 -2014-01-10,6739.94,6691.34,6769.94,6691.34,811610000,0.73 -2014-01-09,6691.34,6721.78,6746.41,6679.31,782900000,-0.45 -2014-01-08,6721.78,6755.45,6755.53,6713.39,720030000,-0.50 -2014-01-07,6755.45,6730.73,6768.89,6718.07,672380000,0.37 -2014-01-06,6730.73,6730.67,6751.98,6714.64,524390000,0.00 -2014-01-03,6730.67,6717.91,6747.33,6699.27,374840000,0.19 -2014-01-02,6717.91,6749.09,6759.37,6707.48,459530000,-0.46 diff --git a/examples/blocks/src/ohlc/index.html b/examples/blocks/src/ohlc/index.html deleted file mode 100644 index f7bb987a97..0000000000 --- a/examples/blocks/src/ohlc/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - \ No newline at end of file diff --git a/examples/blocks/src/workspace/index.html b/examples/blocks/src/workspace/index.html deleted file mode 100644 index 3e884abebc..0000000000 --- a/examples/blocks/src/workspace/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/blocks/src/workspace/workspace.js b/examples/blocks/src/workspace/workspace.js deleted file mode 100644 index d788360bcb..0000000000 --- a/examples/blocks/src/workspace/workspace.js +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2017, the Perspective Authors. - * - * This file is part of the Perspective library, distributed under the terms of - * the Apache License 2.0. The full license can be found in the LICENSE file. - * - */ -const datasource = async () => { - const req = fetch("./superstore.arrow"); - const resp = await req; - const buffer = await resp.arrayBuffer(); - const worker = window.perspective.shared_worker(); - return await worker.table(buffer); -}; - -window.addEventListener("DOMContentLoaded", async function () { - const workspace = document.getElementsByTagName("perspective-workspace")[0]; - workspace.addTable("superstore", await datasource()); - - const config = { - detail: { - main: { - currentIndex: 0, - type: "tab-area", - widgets: [{table: "superstore"}], - }, - }, - }; - workspace.restore(config); -}); diff --git a/examples/git-history/index.html b/examples/git-history/index.html index 1d7c5074f0..4ae3267965 100644 --- a/examples/git-history/index.html +++ b/examples/git-history/index.html @@ -9,42 +9,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + diff --git a/examples/git-history/server.js b/examples/git-history/server.js index 7ed4370e34..e64f914c48 100644 --- a/examples/git-history/server.js +++ b/examples/git-history/server.js @@ -18,10 +18,19 @@ function execute(command, callback) { const server = new WebSocketServer({assets: [__dirname]}); +const schema = { + Hash: "string", + Name: "string", + Date: "integer", + Message: "string", + Email: "string", +}; + execute( - `git log --date=iso --pretty=format:'"%h","%an","%aD","%s","%ae"'`, - (log) => { - const tbl = table("Hash,Name,Date,Message,Email\n" + log); + `git log --date=unix --pretty=format:'^^^^%h^^^^,^^^^%an^^^^,%ad,^^^^%s^^^^,^^^^%ae^^^^' | sed 's/"//g' | sed 's/\\^^^^/"/g'`, + async (log) => { + const tbl = await table(schema); + await tbl.update("Hash,Name,Date,Message,Email\n" + log); server.host_table("data_source_one", tbl); } ); diff --git a/examples/remote-express-typescript/package.json b/examples/remote-express-typescript/package.json deleted file mode 100644 index b7ee058a34..0000000000 --- a/examples/remote-express-typescript/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "remote-express-typescript", - "private": true, - "version": "1.0.0-rc.2", - "description": "An example of 2 Perspectives, one client and one server, streaming via Apache Arrow.", - "scripts": { - "start": "tsc && node dist/server.js" - }, - "keywords": [], - "license": "Apache-2.0", - "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2" - }, - "devDependencies": { - "@types/express": "^4.17.3", - "@types/express-ws": "^3.0.0" - } -} diff --git a/examples/remote-express/README.md b/examples/remote-express/README.md deleted file mode 100644 index 102106a5ac..0000000000 --- a/examples/remote-express/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Remote Example - -An express node.js server example hosting a perspective table to a client-side -perspective running in a WebWorker. Both "State of the World" and subsequent -update data are transferred via Arrow-encoded ArrayBuffers over WebSocket. \ No newline at end of file diff --git a/examples/remote-express-typescript/assets/index.css b/examples/remote-express/assets/index.css similarity index 100% rename from examples/remote-express-typescript/assets/index.css rename to examples/remote-express/assets/index.css diff --git a/examples/remote-express-typescript/assets/index.html b/examples/remote-express/assets/index.html similarity index 100% rename from examples/remote-express-typescript/assets/index.html rename to examples/remote-express/assets/index.html diff --git a/examples/remote-express/index.css b/examples/remote-express/index.css deleted file mode 100644 index 816a438bc9..0000000000 --- a/examples/remote-express/index.css +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2017, the Perspective Authors. - * - * This file is part of the Perspective library, distributed under the terms of - * the Apache License 2.0. The full license can be found in the LICENSE file. - * - */ - - perspective-viewer { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; -} - -@media (max-width: 600px) { - html { - overflow: hidden; - } - - body { - position: fixed; - height: 100%; - width: 100%; - margin: 0; - overflow: hidden; - touch-action: none; - } -} \ No newline at end of file diff --git a/examples/remote-express/index.html b/examples/remote-express/index.html deleted file mode 100644 index c79ba3b2d2..0000000000 --- a/examples/remote-express/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/remote-express/package.json b/examples/remote-express/package.json index b55d7f07f0..b1b4738620 100644 --- a/examples/remote-express/package.json +++ b/examples/remote-express/package.json @@ -4,7 +4,7 @@ "version": "1.0.0-rc.2", "description": "An example of 2 Perspectives, one client and one server, streaming via Apache Arrow.", "scripts": { - "start": "node server.js" + "start": "tsc && node dist/server.js" }, "keywords": [], "license": "Apache-2.0", @@ -12,8 +12,10 @@ "@finos/perspective": "^1.0.0-rc.2", "@finos/perspective-viewer": "^1.0.0-rc.2", "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "express": "^4.17.1", - "express-ws": "^4.0.0" + "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2" + }, + "devDependencies": { + "@types/express": "^4.17.3", + "@types/express-ws": "^3.0.0" } } diff --git a/examples/remote-express/server.js b/examples/remote-express/server.js deleted file mode 100644 index 1d55c7aa60..0000000000 --- a/examples/remote-express/server.js +++ /dev/null @@ -1,29 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 2017, the Perspective Authors. - * - * This file is part of the Perspective library, distributed under the terms of - * the Apache License 2.0. The full license can be found in the LICENSE file. - * - */ - -const {WebSocketManager, perspective_assets} = require("@finos/perspective"); -const express = require("express"); -const expressWs = require("express-ws"); -const {securities} = require("../datasources"); - -const app = express(); -expressWs(app); - -// create Perspective WebSocketManager and host table -const manager = new WebSocketManager(); -securities().then((table) => manager.host_table("remote_table", table)); - -// add connection to manager whenever a new client connects -app.ws("/subscribe", (ws) => manager.add_connection(ws)); - -app.use("/", perspective_assets([__dirname], true)); - -const server = app.listen(8080, () => - console.log(`Listening on port ${server.address().port}`) -); diff --git a/examples/remote-express-typescript/src/server.ts b/examples/remote-express/src/server.ts similarity index 100% rename from examples/remote-express-typescript/src/server.ts rename to examples/remote-express/src/server.ts diff --git a/examples/remote-express-typescript/tsconfig.json b/examples/remote-express/tsconfig.json similarity index 100% rename from examples/remote-express-typescript/tsconfig.json rename to examples/remote-express/tsconfig.json diff --git a/examples/remote-workspace/src/index.js b/examples/remote-workspace/src/index.js index d08f03d57f..41a2b27ada 100644 --- a/examples/remote-workspace/src/index.js +++ b/examples/remote-workspace/src/index.js @@ -8,17 +8,17 @@ */ import perspective from "@finos/perspective"; +import "@finos/perspective-workspace"; import "@finos/perspective-viewer-datagrid"; import "@finos/perspective-viewer-d3fc"; -import "@finos/perspective-workspace"; import "./index.less"; window.addEventListener("DOMContentLoaded", async () => { const websocket = perspective.websocket("ws://localhost:8081"); const worker = perspective.shared_worker(); - const server_table = websocket.open_table("securities_table"); - const table = await worker.table(await server_table.view(), {limit: 10000}); + const server_table = await websocket.open_table("securities_table"); + const table = worker.table(await server_table.view(), {limit: 10000}); const workspace = document.createElement("perspective-workspace"); document.body.appendChild(workspace); @@ -50,15 +50,15 @@ window.addEventListener("DOMContentLoaded", async () => { table: "securities", name: "Heat Map", plugin: "heatmap", - "row-pivots": ["client"], + row_pivots: ["client"], columns: ["chg"], - "column-pivots": '["name"]', + column_pivots: '["name"]', }, Two: { table: "securities", name: "Bar Chart", plugin: "X Bar", - "row-pivots": ["client"], + row_pivots: ["client"], columns: ["chg"], }, }, diff --git a/examples/tornado-python/index.html b/examples/tornado-python/index.html index a533abbe67..dd9ae0a899 100644 --- a/examples/tornado-python/index.html +++ b/examples/tornado-python/index.html @@ -63,7 +63,7 @@ * server. All public API methods are available through this * proxied table. */ - const server_table = websocket.open_table("data_source_one"); + const server_table = await websocket.open_table("data_source_one"); /** * Create a `View` on the server. @@ -88,7 +88,7 @@ * synchronization between server and client, see * `client_server_editing.html`. */ - const table = await worker.table(server_view, { + const table = worker.table(server_view, { index: await server_table.get_index() }); diff --git a/examples/tornado-streaming-python/index.html b/examples/tornado-streaming-python/index.html index 943efd1a12..a94e7f4682 100644 --- a/examples/tornado-streaming-python/index.html +++ b/examples/tornado-streaming-python/index.html @@ -9,66 +9,71 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + diff --git a/examples/webpack-cross-origin/src/index.css b/examples/webpack-cross-origin/src/index.css index b6941ba1e5..746b6a607a 100644 --- a/examples/webpack-cross-origin/src/index.css +++ b/examples/webpack-cross-origin/src/index.css @@ -8,6 +8,8 @@ * */ +@import "~@finos/perspective-viewer/dist/umd/material-dense.css"; + perspective-viewer { position: absolute; top: 0; diff --git a/examples/webpack-cross-origin/src/index.js b/examples/webpack-cross-origin/src/index.js index 0beae7b419..455397e035 100644 --- a/examples/webpack-cross-origin/src/index.js +++ b/examples/webpack-cross-origin/src/index.js @@ -15,7 +15,7 @@ import "@finos/perspective-viewer-d3fc"; window.addEventListener("DOMContentLoaded", async () => { const worker = perspective.worker(); - const table = await worker.table([ + const table = worker.table([ {x: 1, y: 2}, {x: 2, y: 2}, ]); diff --git a/examples/webpack/src/index.js b/examples/webpack/src/index.js index 393355b42f..94d324760e 100644 --- a/examples/webpack/src/index.js +++ b/examples/webpack/src/index.js @@ -11,7 +11,7 @@ import perspective from "@finos/perspective"; import "@finos/perspective-viewer"; import "@finos/perspective-viewer-datagrid"; -import "@finos/perspective-viewer-d3fc"; +import "@finos/perspective-viewer-d3fc/bar"; import "@finos/perspective-viewer/dist/umd/material-dense.dark.css"; diff --git a/examples/workspace-editing-python/src/index.js b/examples/workspace-editing-python/src/index.js index 966212b635..d1668b5c0a 100644 --- a/examples/workspace-editing-python/src/index.js +++ b/examples/workspace-editing-python/src/index.js @@ -8,9 +8,9 @@ */ import perspective from "@finos/perspective"; +import "@finos/perspective-workspace"; import "@finos/perspective-viewer-datagrid"; import "@finos/perspective-viewer-d3fc"; -import "@finos/perspective-workspace"; import "./index.less"; @@ -32,7 +32,7 @@ const worker = perspective.shared_worker(); * `open_table` allows you to call API methods on remotely hosted Perspective * tables just as you would on a locally created table. */ -const server_table = websocket.open_table("data_source_one"); +const server_table_promise = websocket.open_table("data_source_one"); let server_view; // All viewers are based on the same table, which then feed edits back to a @@ -55,6 +55,7 @@ const PORTS = []; */ const datasource = async function () { const load_start = performance.now(); + const server_table = await server_table_promise; server_view = await server_table.view(); // The API of the remote table/view are symmetric. @@ -166,7 +167,7 @@ window.addEventListener("load", async () => { }); // Register the client-side table we just created. - window.workspace.tables.set("datasource", table); + window.workspace.tables.set("datasource", Promise.resolve(table)); // Give the workspace a layout to display. window.workspace.restore({ diff --git a/examples/workspace/src/index.js b/examples/workspace/src/index.js index eacbd8c079..c5f99439d7 100644 --- a/examples/workspace/src/index.js +++ b/examples/workspace/src/index.js @@ -38,13 +38,13 @@ const DEFAULT_LAYOUT = { Three: { table: "superstore", name: "Test Widget III (modified)", - "row-pivots": ["State"], + row_pivots: ["State"], columns: ["Sales", "Profit"], }, Four: { table: "superstore", name: "Test Widget IV (modified)", - "row-pivots": ["Category", "Sub-Category"], + row_pivots: ["Category", "Sub-Category"], columns: ["Sales", "Profit"], }, }, From 5fb1cb14cf68a59d6d9f997d06e0800057c24c99 Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Sat, 9 Oct 2021 00:11:49 -0400 Subject: [PATCH 04/10] Fix docusaurus site --- docs/js/concepts.js | 30 ++- docs/js/index.js | 3 + docs/md/concepts.md | 523 ------------------------------------- docs/md/development.md | 9 +- docs/md/installation.md | 193 -------------- docs/md/js.md | 292 ++++++++++----------- docs/md/styles.md | 18 -- docs/md/view.md | 185 ++++++++----- docs/pages/en/index.js | 52 ++-- docs/siteConfig.js | 32 ++- docs/static/css/custom.css | 2 +- 11 files changed, 346 insertions(+), 993 deletions(-) delete mode 100644 docs/md/concepts.md delete mode 100644 docs/md/installation.md delete mode 100644 docs/md/styles.md diff --git a/docs/js/concepts.js b/docs/js/concepts.js index 0146e57871..51c3fae50f 100644 --- a/docs/js/concepts.js +++ b/docs/js/concepts.js @@ -3,16 +3,29 @@ import perspective from "@finos/perspective"; const worker = perspective.shared_worker(); async function main() { - if (window.location.pathname === "/" || window.location.pathname === "/index.html") { + if ( + window.location.pathname === "/" || + window.location.pathname === "/index.html" + ) { return; } const arrow = await fetch("../../arrow/superstore.arrow"); const table = await worker.table(await arrow.arrayBuffer()); - const viewers = document.querySelectorAll("perspective-viewer:not(.nosuperstore)"); + const viewers = document.querySelectorAll( + "perspective-viewer:not(.nosuperstore)" + ); for (const viewer of viewers) { viewer.load(table); + const token = {}; + for (const attribute of viewer.attributes) { + if (attribute.name !== "settings") { + token[attribute.name] = JSON.parse(attribute.nodeValue); + } + } + + viewer.restore(token); viewer.toggleConfig(); } @@ -24,11 +37,14 @@ async function main() { if (code.classList.contains("language-html")) { continue; } - const name = code.classList.contains("language-javascript") ? "Javascript" : "Python"; + const name = code.classList.contains("language-javascript") + ? "Javascript" + : "Python"; const next = name === "Javascript" ? "Python" : "Javascript"; pre.innerHTML = - `${ICON} ${name} ${ARROW_ICON} ${next}` + pre.innerHTML; + `${ICON} ${name} ${ARROW_ICON} ${next}` + + pre.innerHTML; if (name !== state) { pre.style.display = "none"; } else { @@ -37,7 +53,7 @@ async function main() { } for (const link of document.querySelectorAll("pre a")) { - link.addEventListener("click", event => { + link.addEventListener("click", (event) => { event.preventDefault(); state = state === "Python" ? "Javascript" : "Python"; localStorage.setItem("lang_pref", state); @@ -46,7 +62,9 @@ async function main() { if (!code || code.classList.contains("language-html")) { continue; } - const name = code.classList.contains("language-javascript") ? "Javascript" : "Python"; + const name = code.classList.contains("language-javascript") + ? "Javascript" + : "Python"; if (name !== state) { pre.style.display = "none"; } else if (name !== "html") { diff --git a/docs/js/index.js b/docs/js/index.js index 82c2e495ea..48b19b0b1f 100644 --- a/docs/js/index.js +++ b/docs/js/index.js @@ -1,4 +1,7 @@ import perspective from "@finos/perspective"; + +perspective.shared_worker(); + import "@finos/perspective-viewer"; import "@finos/perspective-viewer-datagrid"; import "@finos/perspective-viewer-d3fc"; diff --git a/docs/md/concepts.md b/docs/md/concepts.md deleted file mode 100644 index b4acc6c835..0000000000 --- a/docs/md/concepts.md +++ /dev/null @@ -1,523 +0,0 @@ ---- -id: concepts -title: Conceptual Overview ---- - -Perspective is designed and built as an _interactive_ visualization component -for _large, real-time_ datasets. It is designed to be fast, intuitive, and -easily composable, making fine-grained analysis possible on any dataset. - -## Overview - -This document outlines the main concepts behind Perspective: - -- [`Table`](#table) Perspective's typed data interface -- [`View`](#view) a query from a `Table` that calculates and returns data - -and explains (with live examples) the query options that can be used to create a -`View`: - -- [`row_pivots`](#row-pivots) splitting the dataset by unique row values -- [`column_pivots`](#column-pivots) splitting the dataset by unique column - values -- [`aggregates`](#aggregates) calculations over the dataset such as `sum`, - `average`, or `distinct count` -- [`columns`](#columns) specifying the columns the user is interested in seeing -- [`sort`](#sort) ordering the dataset based on a column's values -- [`filter`](#filter) filtering the dataset based on a column's values - -For language-specific guidance, API documentation, or quick-start user guides, -use the sidebar to find the documentation for the language of choice. Though the -way these concepts operate in practice may vary slightly across different -languages based on nuance, the concepts documented here hold true across all -implementations of the Perspective library. - - - - - - -## Table - -The `Table` is Perspective's data interface, serving as the base on which all -operations can be called. - -A `Table` contains columns, each of which have a unique name, are strongly and -consistently typed, and contains rows of data conforming to the column's type. -Each column in a `Table` must have the same number of rows, though not every row -must contain data; null-values are used to indicate missing values in the -dataset. - -The columns of a `Table` are _immutable after creation_, which means their names -and data types cannot be changed after the `Table` has been created. Columns -cannot be added or deleted after creation, but a `View` can be used to select an -arbitrary set of columns from the `Table`. - -The immutability of columns and data types after creation is important, as it -allows Perspective to operate quickly over a large dataset and accumulate data -without additional recalculation. - -### Schema and Supported Data Types - -The mapping of a `Table`'s column names to data types is referred to as a -`schema`. Each column has a unique name and a single data type: - -```javascript -const schema = { - a: "integer", - b: "float", - c: "date", - d: "datetime", - e: "boolean", - f: "string", -}; -``` - -Because Perspective is built in multiple languages, data types are expressed -with a common vocabulary of across all supported host languages. These _String_ -types are used to represent the data supported by Perspective: - -- `"integer"`: a 32-bit (or 64-bit depending on platform) integer -- `"float"`: a 64-bit float -- `"boolean"`: a boolean value of true or false -- `"date"`: a date containing year, month, and day -- `"datetime"`: a datetime containing year, month, day, hour, minute, second, - and microsecond -- `"string"`: a unicode string without any character limits - -In supported languages e.g. Python, you may alternatively use native types: - -```python -from datetime import date, datetime - -schema = { - "a": int, - "b": float, - "c": date, - "d": datetime, - "e": bool, - "f": str -} -``` - -### Constructing a `Table` - -A `Table` can be initialized in two ways: - -- With a [`schema`](#schema-and-data-types); this table will be initialized - empty. -- With a dataset in a supported format; in this case, a `schema` is inferred - from the dataset's structure upon initialization. Perspective supports a - variety of table-like data structures in Python and Javascript such as CSV, - `pandas.DataFrame` and JSON; see the language specific API documentation for a - comprehensive list of supported formats. - -### Limit - -Initializing a `Table` with a `limit` sets the total number of rows the `Table` -is allowed to have. When the `Table` is updated, and the resulting size of the -`Table` would exceed its `limit`, rows that exceed `limit` overwrite the oldest -rows in the `Table`. - -To create a `Table` with a `limit`, provide the `limit` property with an integer -indicating the `limit`: - -```javascript -const table = await perspective.table(data, { limit: 1000 }); -``` - -`limit` cannot be used in conjunction with `index`. - -### Index - -Initializing a `Table` with an `index` allows Perspective to treat a column as -the primary key, allowing in-place updates of rows. Only a single column can be -used as an `index`, and like other `Table` parameters, cannot be changed or -removed after the `Table` creation. A column of any type may be used as an -`index`. - -To create an indexed `Table`, provide the `index` property with a string column -name to be used as an index: - -```javascript -const table = await perspective.table(data, { index: "a" }); -``` - -An indexed `Table` allows for in-place _updates_ whenever a new rows shares an -`index` values with an existing row, _partial updates_ when such a row leaves -some column values `undefined`, and _removes_ to delete a row by `index`. - -### `update()` - -Once a `Table` has been created, it can be updated with new data conforming to -the `Table`'s `schema`. The dataset used for `update()` must conform with the -formats supported by Perspective, and cannot be a `schema` (as the `schema` is -immutable). - -If a `Table` was initialized with a `schema` instead of a dataset, use `update` -to fill the `Table` with data. - -```javascript -const table = await perspective.table({ - a: "integer", - b: "float", -}); -table.update(new_data); -``` - -If `index` is not set, updates _append_ new data to the end of the `Table`. -However, if `index` is set, Perspective allows _partial updates_ (in-place) -using the `index` to determine which rows to update: - -```javascript -// Create an indexed table -const table = await perspective.table( - { - id: [1, 2, 3, 4], - name: ["a", "b", "c", "d"], - }, - { index: "id" } -); - -// Update rows with primary key `1` and `4` -table.update({ - id: [1, 4], - name: ["x", "y"], -}); -``` - -Provide a dataset with the rows to be updated as specified by primary key, and -Perspective handles the lookup into those rows and applies the specified updates -from the dataset. If `update` is called on an indexed `Table` and no primary -keys are specified, or if the specified keys are not present in the `Table`, -Perspective will append the dataset to the end of the `Table`. - -### `remove()` - -An indexed `Table` can also have rows removed by primary key: - -```javascript -// Create an indexed table -const table = await perspective.table( - { - id: [1, 2, 3, 4], - name: ["a", "b", "c", "d"], - }, - { index: "id" } -); - -// Remove rows with primary key `1` and `4` -table.remove([1, 4]); -``` - -To `remove` rows on an indexed `Table`, provide the `Table`'s `remove` method -with an array of primary key values indicating which rows should be removed. - -### `delete()` - -Due to Perspective's runtime composition, it is important to clean up resources -that might have been created by the engine in C++ but cannot be reached by the -binding language's garbage collector (Javascript, Python etc.) - -The `Table`'s `delete` method guarantees the cleanup of all resources associated -with a `Table`, which is _especially important_ in Javascript, as the JS garbage -collector -[cannot automatically clean up](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#memory-management) -objects created in C++ through Emscripten. - -It is best practice to explicitly `delete` any `Table`s when they are no longer -needed. Ensure that the `Table` has no `View`s created from it before deleting, -as an exception will be thrown. - -### `on_delete` - -The `on_delete` callback allows users to execute an action immediately after the -`Table` has been deleted. The callback runs after all resources have been -cleaned up and removed. Multiple `on_delete` callbacks can be set, and they will -run in the order in which they were set. If a callback is no longer needed, call -the `remove_delete` method on the `Table` and provide the reference to a -callback which should be removed and no longer called by Perspective. - -## `View` - -The View is Perspective's query and serialization interface. It represents a -query on the `Table`'s dataset and is always created from an existing `Table` -instance via the `view()` method with a set of -[`View` configuration parameters](https://perspective.finos.org/docs/obj/perspective.html#module_perspective..table+view): - -```javascript -const table = await perspective.table({ - id: [1, 2, 3, 4], - name: ["a", "b", "c", "d"], -}); - -// Create a view showing just the `name` column. -const view = await table.view({ - columns: ["name"], -}); - -// Now you have a `View`! Get your data using ES6 async/await: -const json = async () => await view.to_json(); - -// or using the Promise API -view.to_arrow().then((arrow) => console.log(arrow)); - -// Delete the Query! -view.delete(); -``` - -`View` objects are immutable with respect to the arguments provided to the -`view()` method; to change these parameters, you must create a new `View` on the -same `Table`. However, `View`s are live with respect to the `Table`'s data, and -will (within a conflation window) update with the latest state as its parent's -state updates, including incrementally recalculating all aggregates, pivots, -filters, etc. - -### Schema - -The `View` has its own `schema`, which is a mapping of column names to data -types based on the `View`'s query. - -This differs from the `Table` schema as the `View`'s column names are dependent -on whether the `View` has pivots applied, or whether it has selected certain -columns from the `Table` for inclusion. - -The same holds for the `schema`'s data types, which can be altered depending on -the type of aggregate applied. A `count` aggregate applied over a string column, -for example, will return `"integer"` in the `View`'s `schema`. - -### `on_update` - -The `on_update` callback allows users to execute an action immediately after the -`View`'s underlying `Table` has been updated. This is useful in situations where -updating the `Table` leads to UI changes, recalculations, or any other actions -that need to be triggered. Multiple `on_update` callbacks can be specified, and -they will run in the order in which they were set. If a callback is no longer -needed to run, use the `remove_update` method on the `View` instance. - -### `on_delete` - -The `on_delete` callback allows users to execute an action immediately after the -`View` has been deleted. Multiple `on_delete` callbacks can be specified, and -they will run in the order in which they were set. If a callback is no longer -needed, call the `remove_delete` method on the `View` instance. - -### `delete()` - -Similar to the `Table`, the `View`'s `delete` method guarantees cleanup of the -resources associated with the `View`. It is best practice to explicit delete -`View`s when they are no longer needed. All `View`s created from a `Table` -instance must be explicitly deleted before the `Table` can be deleted. - -## `View` Query Parameters - -The `View`'s query parameters present a powerful and composable interface for -data query and transformation. All parameters can be applied in conjunction with -each other, and there is no limit to the number of pivots, filters, etc. that -can be applied. - -_All_ examples in this section are live—feel free to play around with each -`` instance to see how different query parameters affect -what you see. - -### Row Pivots - -A row pivot _groups_ the dataset by the unique values of each column used as a -row pivot - a close analogue in SQL would be the `GROUP BY` statement. - -The underlying dataset is aggregated to show the values belonging to each group, -and a total row is calculated for each group, showing the currently selected -aggregated value (e.g. `sum`) of the column. Row pivots are useful for -hierarchies, categorizing data and attributing values, i.e. showing the number -of units sold based on State and City. - -In Perspective, row pivots are represented as an array of string column names -which will be applied as row pivots: - -```javascript -const view = await table.view({ row_pivots: ["a", "c"] }); -``` - -Pivots are applied in the order provided by the user, which allows for "drilling -down" into data; for example, a row pivot of `["State", "City", "Neighborhood"]` -shows the values for each neighborhood, which is grouped by city, which is in -turn grouped by state. This allows for extremely fine-grained analysis applied -over a large dataset. - -#### Example - -```html - -``` - -
- - -
- -### Column Pivots - -A column pivot _splits_ the dataset by the unique values of each column used as -a column pivot. The underlying dataset is not aggregated, and a new column is -created for each unique value of the column pivot. Each newly created column -contains the parts of the dataset that correspond to the column header, i.e. a -`View` that has `["State"]` as its column pivot will have a new column for each -state. - -In Perspective, column pivots are represented as an array of string column names -which will be applied as column pivots: - -```javascript -const view = await table.view({ column_pivots: ["a", "c"] }); -``` - -Row pivots and column pivots can be used in conjunction to categorize and -traverse over datasets, showing the insights a user is interested in. Row and -column pivots are also easily transposable in `perspective-viewer`. - -#### Example - -```html - -``` - -
- - -
- -### Aggregates - -Aggregates perform a calculation over an entire column, and are displayed when -one or more [Row Pivots](#row-pivots) are applied to the `View`. Aggregates can -be specified by the user, or Perspective will use the following sensible default -aggregates based on column type: - -- "sum" for `integer` and `float` columns -- "count" for all other columns - -Perspective provides a large selection of aggregate functions that can be -applied to columns in the `View` constructor using a dictionary of column name -to aggregate function name: - -```javascript -const view = await table.view({ - aggregates: { - a: "avg", - b: "distinct count", - }, -}); -``` - -#### Example - -```html - -``` - -
- - -
- -### Columns - -The `columns` property specifies which columns should be included in the -`View`'s output. This allows users to show or hide a specific subset of columns, -as well as control the order in which columns appear to the user. - -This is represented in Perspective as an array of string column names passed to -the `View` constructor: - -```javascript -const view = await table.view({ - columns: ["a"], -}); -``` - -#### Example - -```html - -``` - -
- - -
- -### Sort - -The `sort` property specifies columns on which the query should be sorted, -analogous to `ORDER BY` in SQL. A column can be sorted regardless of its data -type, and sorts can be applied in ascending or descending order. - -Perspective represents `sort` as an array of arrays, with the values of each -inner array being a string column name and a string sort direction: - -```javascript -const view = await table.view({ - sort: [["a", "asc"]], -}); -``` - -#### Example - -```html - -``` - -
- - -
- -### Filter - -The `filter` property specifies columns on which the query can be filtered, -returning rows that pass the specified filter condition. This is analogous to -the `WHERE` clause in SQL. There is no limit on the number of columns where -`filter` is applied, but the resulting dataset is one that passes all the filter -conditions, i.e. the filters are joined with an `AND` condition. - -Perspective represents `filter` as an array of arrays, with the values of each -inner array being a string column name, a string filter operator, and a filter -operand in the type of the column: - -```javascript -const view = await table.view({ - filter: [["a", "<", 100]], -}); -``` - -#### Example - -Note: Use the `filters` attribute on `` instead of `filter`. - -```html - -``` - -
- - -
diff --git a/docs/md/development.md b/docs/md/development.md index 2dc757354b..8e316fd24b 100644 --- a/docs/md/development.md +++ b/docs/md/development.md @@ -31,6 +31,11 @@ dependencies to be installed: - [Boost](https://www.boost.org/) (version 1.67 or higher, must be built - not header-only) - [Flatbuffers](https://google.github.io/flatbuffers/flatbuffers_guide_building.html) +- [wasm-pack](https://github.com/rustwasm/wasm-pack) + +**_This list may be non-exhaustive depending on your OS/environment; please open +a thread in [Discussions](https://github.com/finos/perspective/discussions) if +you have any questions_** ## Build @@ -52,10 +57,10 @@ yarn setup ``` If everything is successful, you should be able to run any of the `examples/` -packages, e.g. `examples/simple` like so: +packages, e.g. `examples/blocks` like so: ```bash -yarn start simple +yarn start blocks ``` ## `Perspective.js` diff --git a/docs/md/installation.md b/docs/md/installation.md deleted file mode 100644 index d2023da3f7..0000000000 --- a/docs/md/installation.md +++ /dev/null @@ -1,193 +0,0 @@ ---- -id: installation -title: Installation ---- - -## Javascript - -Because Perspective uses both WebAssembly and Web Workers, each of which place -constraints on how assets and scripts must be loaded, the installation process -for Perspective in a Javascript environment is more complex than most "pure" -Javascript libraries. - -### From NPM - -For using Perspective from Node.js, or as a dependency in a `package.json` based -`webpack` or other browser application build toolchain, Perspective is available -via NPM: - -```bash -$ yarn add @finos/perspective-viewer @finos/perspective-viewer-d3fc @finos/perspective-viewer-datagrid -``` - -#### An important note about Hosting - -All uses of Perspective from NPM require the browser to have access to -Perspective's `.worker.*.js` and `.wasm` assets _in addition_ to the bundled -`.js` scripts. By default, Perspective -[inlines](https://github.com/finos/perspective/pull/870) these assets into the -`.js` scripts, and delivers them in one file. This has no performance impact, -but does increase asset load time. Any non-trivial application should make use -of `@finos/perspective-webpack-plugin`, which automatically splits the assets -into separate files and downloads them when the bundling step runs. - -### Webpack Plugin - -When importing `perspective` from NPM modules for a browser application, you -should use `@finos/perspective-webpack-plugin` to manage the `.worker.*.js` and -`.wasm` assets for you. The plugin handles downloading and packaging -Perspective's additional assets, and is easy to set up in your `webpack.config`: - -```javascript -const PerspectivePlugin = require("@finos/perspective-webpack-plugin"); - -module.exports = { - entry: "./in.js", - output: { - filename: "out.js", - path: "build", - }, - plugins: [new PerspectivePlugin()], -}; -``` - -### From CDN - -Perspective can be loaded directly from -[unpkg.com](https://unpkg.com/@finos/perspective-viewer), which is the easiest -way to get started with Perspective in the browser, and absolutely perfect for -spinning up quick instances of `perspective-viewer`. An example is demonstrated -in -[`superstore-arrow.html`](https://github.com/finos/perspective/blob/master/examples/simple/superstore-arrow.html), -which loads a dataset stored in the Apache Arrow format using the `Fetch` API. - -Add these scripts to your `.html`'s `` section: - -```html - - - - -``` - -Once added to your page, you can access the Javascript API through the -`perspective` symbol: - -```javascript -const worker = perspective.worker(); -const table = await worker.table({ A: [1, 2, 3] }); -const view = await table.view({ sort: [["A", "desc"]] }); -``` - -Or create a `` in HTML: - -```html -` - - -``` - -You may choose to wait for the document's `DOMContentLoaded` event to fire, -which indicates that all page DOM content is available. - -This makes it extremely easy to spin up Perspective locally without depending on -a build chain or other tooling. For production usage, you should incorporate -Perspective into your application's bundled scripts using `NPM` and `Webpack`. - -## Python - -`perspective-python` contains full bindings to the Perspective API, a JupyterLab -widget, and a [Tornado](http://www.tornadoweb.org/en/stable/) WebSocket handler -that allows you to host Perspective using server-side Python. - -In addition to supporting row/columnar formats of data using `dict` and `list`, -`pandas.DataFrame`, dictionaries of NumPy arrays, NumPy structured arrays, and -NumPy record arrays are all supported in `perspective-python`. - -`perspective-python` can be installed from `pip`: - -```bash -pip install perspective-python -``` - -### Troubleshooting installation from source - -If you are installing from a source distribution (sdist), make sure you have -CMake and Boost headers present on your machine: - -- CMake (version 3.15.4 or higher) -- Boost Headers (version 1.67) - -Try installing in verbose mode: - -```bash -pip install -vv perspective-python -``` - -The most common culprits are: - -- CMake version too old -- Boost headers are missing or too old -- PyArrow not installed prior to installing perspective - -Additionally, due to PEP-518 and build isolation, its possible that the version -of PyArrow that pip uses to build perspective-python is different from the one -you have installed. To disable this, pass the `--no-build-isolation` flag to -pip. - -#### Wheels PyArrow linkage - -Because we compile Apache Arrow from source to webassembly via Emscripten, we -have a tight coupling on the specific version of Apache Arrow that must be used. -As such, we link against a specific Apache Arrow version which must be present. -Currently, our wheels build against PyArrow==0.17.1 for Python 3.\* and -PyArrow==0.16.0 for Python 2.7. - -To ignore compiled wheels and install from source with pip, install via - -```bash -pip install --no-binary perspective-python -``` - -### Jupyterlab - -`PerspectiveWidget` is a JupyterLab widget that implements the same API as -``, allowing for fast, intuitive -transformations/visualizations of various data formats within JupyterLab. - - - -To use the JupyterLab plugin, make sure you have installed `perspective-python` -and then install the extension from the Jupyter lab extension directory: - -```bash -jupyter labextension install @finos/perspective-jupyterlab -``` - -If the widget does not display, you might be missing the -[ipywidgets extension](https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension). -Install it from the extension directory: - -```bash -jupyter labextension install @jupyter-widgets/jupyterlab-manager -``` - -## From source - -For hackers, contributors, and masochists, Perspective can be installed directly -from source available on [Github](https://github.com/finos/perspective). Doing -so is quite a bit more complex than a standard pure Javascript NPM package, so -if you're not looking to hack on Perspective itself, you are likely better off -choosing the CDN or NPM methods above. See the -[developer docs](development.html) for details. diff --git a/docs/md/js.md b/docs/md/js.md index aee11ba9be..3efef3201a 100644 --- a/docs/md/js.md +++ b/docs/md/js.md @@ -36,12 +36,20 @@ runtime performance impact, but does increase asset load time. Most apps should make use of `@finos/perspective-webpack-plugin` which will package these files correctly form your existing Webpack configuration. -### Webpack Plugin +### Webpack Plugin (optional) When importing `perspective` from NPM modules for a browser application, you should use `@finos/perspective-webpack-plugin` to manage the `.worker.js` and -`.wasm` assets for you. The plugin handles downloading and packaging -Perspective's additional assets, and is easy to set up in your `webpack.config`: +`.wasm` assets for you. Doing so will improve your application's initial load +performance, the plugin-compiled version of Perspective .. + +- Downloads `.wasm` and `.js` assets in parallel. +- Compiles `.wasm` incrementally via [streaming instantiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming). +- Lazily downloads large features only when used such as `monaco-editor`. +- overall bundle size is ~20% smaller (due to bas64 encoding overhead). + +The plugin handles downloading and packaging Perspective's additional assets, +and is easy to set up in your `webpack.config`: ```javascript const PerspectivePlugin = require("@finos/perspective-webpack-plugin"); @@ -56,34 +64,27 @@ module.exports = { }; ``` -Otherwise, you'll need to configure your `webpack.config.js` to handle these -`perspective` assets correctly. ~`@finos/perspective-webpack-plugin` itself uses -a combination of `worker-loader` and `file-loader` (or `arraybuffer-loader` to -inline the contents of this file as a base64-encoded string), which can be -easily modified as needed: +`@finos/perspective-viewer` has a dependence on [`monaco-editor`](https://microsoft.github.io/monaco-editor/), +which itself depends on severl CSS assets. If your webpack config uses a +loader for `"*.css"` or similar, you may need to exclude `monaco-editor` from +this loader to prevent double-encoding: ```javascript module.exports = { - rules: [ - { - test: /perspective\.worker\.js$/, - type: "javascript/auto", - include: path.dirname(require.resolve("@finos/perspective")), - loader: "worker-loader", - }, - { - test: /perspective\.wasm$/, - type: "javascript/auto", - include: path.dirname(require.resolve("@finos/perspective")), - loader: "file-loader", // or "arraybuffer-loader" - }, - { - test: /perspective-viewer\.wasm$/, - type: "javascript/auto", - include: path.dirname(require.resolve("@finos/perspective-viewer")), - loader: "file-loader", // or "arraybuffer-loader" - }, - ], + // ... + + module: { + rules: [ + { + test: /\.css$/, + exclude: [/monaco-editor/], // <- Exclude `monaco-editor` + use: [ + {loader: "style-loader"}, + {loader: "css-loader"}, + ], + } + ] + } }; ``` @@ -128,7 +129,7 @@ Or create a `` in HTML: }; // The `` HTML element exposes the viewer API const worker = perspective.worker(); - const table = await worker.table(data); + const table = worker.table(data); const el = document.getElementsByTagName("perspective-viewer")[0]; el.load(table); }); @@ -321,83 +322,6 @@ view.delete(); table.delete(); ``` -### Customizing behavior with `perspective.config.js` - -For ease of configuration synchronization between the Node.js, WebWorker and -Browser, Perspective supports configuration statically. - -You may override Perspective's -[default settings](https://github.com/finos/perspective/blob/master/packages/perspective/src/js/config/settings.js) -via a `perspective.config.js` or `perspective.config.json` file in your -project's root or parent path, or via the `"perspective"` key in your project's -`package.json`. - -Note that, while in Node.js, this config file is read at runtime; for the -browser, this file must be read at compile time (handled automatically via -[`@finos/perspective-webpack-plugin`](https://github.com/finos/perspective/tree/master/packages/perspective-webpack-plugin)). - -Thus, to update it, you must either rebuild your code, or supply the JSON -configuration object to the `worker()` constructor on initialization. - -```javascript -module.exports = { - types: { - string: { - aggregate: "dominant", - }, - float: { - format: { - style: "decimal", - minimumFractionDigits: 2, - maximumFractionDigits: 2, - }, - }, - }, -}; -``` - -#### Creating new types - -For customizing the behavior or style of specific columns, Perspective supports -the definition of new types that derive from an existing built-in type. First, -add a new type and declare its base in your `perspective.config.js`: - -```javascript -module.exports = { - types: { - price: { type: "float" }, - }, -}; -``` - -Perspective will not infer these types for you, so you'll need to create your -table [from a schema](#loading-data-with-table) to use them: - -```javascript -const table = await worker.table({ volume: "integer", price: "price" }); -table.update([{ volume: 10, price: 100.75 }]); -``` - -#### Formatting data types - -Default and user-created types can be styled using the `format` key in -`perspective.config.js`: - -```javascript -module.exports = { - types: { - price: { - type: float, - format: { - style: "decimal", - minimumFractionDigits: 2, - maximumFractionDigits: 2, - }, - }, - }, -}; -``` - ## `perspective-viewer` web component `` provides a complete graphical UI for configuring the @@ -415,15 +339,6 @@ import "@finos/perspective-viewer-datagrid"; import "@finos/perspective-viewer-d3fc"; ``` -While each plugin module by default will register all of its visualization -types, you may choose to import these individually as well: - -```javascript -import "@finos/perspective-viewer-d3fc/bar"; -import "@finos/perspective-viewer-d3fc/column"; -import "@finos/perspective-viewer-d3fc/xy-scatter"; -``` - Once imported, the `` Web Component will be available in any standard HTML on your site. A simple example: @@ -440,13 +355,10 @@ themed accordingly: ```javascript //Themes based on Google's Material Design Language -import "@finos/perspective-viewer/themes/material.css"; -import "@finos/perspective-viewer/themes/material.dark.css"; -import "@finos/perspective-viewer/themes/material-dense.css"; -import "@finos/perspective-viewer/themes/material-dense.dark.css"; - -//Vaporwave theme -import "@finos/perspective-viewer/themes/vaporwave.css"; +import "@finos/perspective-viewer/dist/umd/material.css"; +import "@finos/perspective-viewer/dist/umd/material.dark.css"; +import "@finos/perspective-viewer/dist/umd/material-dense.css"; +import "@finos/perspective-viewer/dist/umd/material-dense.dark.css"; ``` **_Note that importing multiple themes may override each other_** @@ -466,17 +378,19 @@ import "@finos/perspective-viewer/themes/all-themes.css"; _*index.html*_ ```html - + + + + - ``` If you choose not to bundle the themes yourself, they are available through the @@ -493,11 +407,11 @@ These can be directly linked in your HTML file: ### Loading data into `` -Data can be loaded into `` in the form of a `Table()` via -the `load()` method. +Data can be loaded into `` in the form of a `Table()` or a +`Promise` via the `load()` method. ```javascript -// Create a new worker, then a new table on that worker. +// Create a new worker, then a new table promise on that worker. const table = await perspective.worker().table(data); // Bind a viewer element to this table. @@ -550,8 +464,9 @@ const host = new WebSocketServer({ assets: [__dirname], port: 8080 }); // Read an arrow file from the file system and host it as a named table. const arr = fs.readFileSync(__dirname + "/superstore.arrow"); -const tbl = table(arr); -host.host_table("table_one", tbl); +table(arr).then((table) => { + host.host_table("table_one", table); +}); ``` In the browser: @@ -566,7 +481,7 @@ const websocket = perspective.websocket( // Bind the viewer to the preloaded data source. `table` and `view` objects // live on the server. -const server_table = websocket.open_table("table_one"); +const server_table = await websocket.open_table("table_one"); elem.load(server_table); // Or load data from a table using a view. The browser now also has a copy of @@ -574,7 +489,7 @@ elem.load(server_table); // browser using Apache Arrow. const worker = perspective.worker(); const server_view = await server_table.view(); -const client_table = await worker.table(server_view); +const client_table = worker.table(server_view); elem.load(client_table); ``` @@ -652,50 +567,105 @@ Any operation performed on the `` instance or on `const table` will be forwarded to Python, which will execute the operation and return the results back to JavaScript. -### Setting & reading `perspective-viewer` configuration via attributes +### Persistent `` configuration via `save()`/`restore()`. -`` uses the DOM's regular attribute API to set it's initial -state, by reading JSON encoded properties from attributes for each `perspective` -configuration property. +`` is _persistent_, in that its entire state (sans the data +itself) can be serialized or deserialized. This include all column, filter, +pivot, expressions, etc. properties, as well as datagrid style settings, config +panel visibility, and more. This overloaded feature covers a range of use cases: -For example, this HTML will apply `row_pivot` and `filter` configuration to the -initial `view()` created when data is loaded via the `load()` method, as well as -set the UI controls to reflect this config. See the -[full Attribute API documentation](/docs/obj/perspective-viewer.html) for a full -description of the available attributes. +- Setting a ``'s initial state after a `load()` call. +- Updating a single or subset of properties, without modifying others. +- Resetting some or all properties to their data-relative default. +- Persisting a user's configuration to `localStorage` or a server. -```html - - +#### Serializing and deserializing the viewer state + +To retrieve the entire state as a JSON-ready JavaScript object, use the `save()` +method. `save()` also supports a few other formats such as `"arraybuffer"` and +`"string"` (base64, not JSON), which you may choose for size at the expense of +easy migration/manual-editing. + +```javascript +const json_token = await elem.save(); +const string_token = await elem.save("string"); ``` -Attributes on a `` are reactive. When the user interacts -with the viewer, the attributes update to reflect the current viewer state, and -these can be read with the standard DOM API method `getAttribute()`; likewise, -the `setAttribute()` method will update the `view()` and UI state. +For any format, the serialized token can be restored to any +`` with a `Table` of identical schema, via the `restore()` +method. Note that while the data for a token returned from `save()` may differ, +generally its schema may not, as many other settings depend on column names and +types. ```javascript -// Gets `elem`'s pivot state -var pivots = elem.getAttribute("row-pivots"); +await elem.restore(json_token); +await elem.restore(string_token); +``` + +As `restore()` dispatches on the token's type, it is important to make sure that +these types match! A common source of error occurs when passing a +JSON-stringified token to `restore()`, which will assume base64-encoded msgpack +when a string token is used. -// Set `elems`'s sort state -elem.setAttribute("sort", JSON.stringify([["Sales", "desc"]])); +```javascript +// This will error! +await elem.restore(JSON.stringify(json_token)); ``` -Alternatively, the `save()` and `restore()` methods allow you to read and write, -respectively, all `view()` configuration properties at once. +#### Updating individual properties + +Using the JSON format, every facet of a ``'s configuration +can be manipulated from JavaScript using the `restore()` method. The valid +structure of properties is described via the +[`ViewerConfig`](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L16) +and embedded +[`ViewConfig`](https://github.com/finos/perspective/blob/ebced4caa19435a2a57d4687be7e428a4efc759b/packages/perspective/index.d.ts#L140) +type declarations, and [`View`](perspective.finos.org/docs/md/view.html) chapter +of the documentation which has several interactive examples for each +`ViewConfig` property. ```javascript -// Get the current elem config -var state = elem.save(); +// Set the plugin (will also update `columns` to plugin-defaults) +await elem.restore({ plugin: "X Bar" }); + +// Update plugin and columns (only draws once) +await elem.restore({ plugin: "X Bar", columns: ["Sales"] }); + +// Open the config panel +await elem.restore({ settings: true }); + +// Create an expression +await elem.restore({ + columns: ['"Sales" + 100'], + expressions: ['"Sales" + 100'], +}); -// ... later +// ERROR if the column does not exist in the schema or expressions .. +// await elem.restore({columns: ["\"Sales\" + 100"], expressions: []}); -// Restore the previously saved state -elem.restore(state); +// Add a filter +await elem.restore({ filter: [["Sales", "<", 100]] }); + +// Add a sort, don't remove filter +await elem.restore({ sort: [["Prodit", "desc"]] }); + +// Reset just filter, preserve sort +await elem.restore({ filter: undefined }); + +// Reset all properties to default e.g. after `load()` +await elem.reset(); +``` + +Another effective way to quickly create a token for a desired configuration is +to simply copy the token returned from `save()` after settings the view manually +in the browser. The JSON format is human-readable and should be quite easy to +tweak once generated, as `save()` will return even the default settings for all +properties. You can call `save()` in your application code, or e.g. through the +Chrome developer console + +```javascript +// Copy to clipboard +copy(await document.querySelector("perspective-viewer").save()); ``` ### Update events diff --git a/docs/md/styles.md b/docs/md/styles.md deleted file mode 100644 index ae7e074305..0000000000 --- a/docs/md/styles.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -id: styles -title: CSS Styles ---- - -The `` custom element supports a variety of styling options -via custom CSS rules, which can be used almost exactly like traditional CSS. -Note that it may be necessary to invoke `restyleElement()` on the custom element -itself before updated CSS rules may apply, if those rules affect canvas-rendered -elements such as the `@finos/perspective-viewer-hypergrid` plugin. - -```javascript -const elem = document.getElementsByTagName("perspective-viewer")[0]; -elem.style.color = "#ff0000"; -elem.restyleElement(); -``` - -**_ Under Construction _** diff --git a/docs/md/view.md b/docs/md/view.md index 467856f82f..ce09f85d9c 100644 --- a/docs/md/view.md +++ b/docs/md/view.md @@ -24,9 +24,9 @@ view.delete(); ``` ```python -const table = perspective.Table({ - "id": [1, 2, 3, 4], - "name": ["a", "b", "c", "d"] +table = perspective.Table({ + "id": [1, 2, 3, 4], + "name": ["a", "b", "c", "d"] }); view = table.view(columns=["name"]); @@ -57,17 +57,17 @@ power multiple `view()`s concurrently: const view = await table.view({ columns: ["Sales"], aggregates: { Sales: "sum" }, - row_pivot: ["Region", "Country"], + row_pivots: ["Region", "Country"], filter: [["Category", "in", ["Furniture", "Technology"]]], }); ``` ```python view = table.view( - columns=["Sales"], - aggregates={"Sales": "sum"}, - row_pivot=["Region", "Country"], - filter=[["Category", "in", ["Furniture", "Technology"]]] + columns=["Sales"], + aggregates={"Sales": "sum"}, + row_pivot=["Region", "Country"], + filter=[["Category", "in", ["Furniture", "Technology"]]] ) ``` @@ -83,8 +83,8 @@ value (e.g. `sum`) of the column. Row pivots are useful for hierarchies, categorizing data and attributing values, i.e. showing the number of units sold based on State and City. In Perspective, row pivots are represented as an array of string column names to pivot, are applied in the order provided; For example, -a row pivot of `["State", "City", "Neighborhood"]` shows the values for each -neighborhood, which are grouped by City, which are in turn grouped by State. +a row pivot of `["State", "City", "Postal Code"]` shows the values for each +Postal Code, which are grouped by City, which are in turn grouped by State. ```javascript const view = await table.view({ row_pivots: ["a", "c"] }); @@ -96,16 +96,22 @@ view = table.view(row_pivots=["a", "c"]) #### Example -```html - - +```javascript +const elem = document.querySelector("perspective-viewer"); +await elem.restore({ + row_pivots: ["State", "City"], +}); +``` + +```python +widget = PerspectiveWidget() +widget.restore( + row_pivots=["State", "City"] +) ```
- +
@@ -129,17 +135,26 @@ view = table.view(column_pivots=["a", "c"]) #### Example -```html - - +```javascript +const elem = document.querySelector("perspective-viewer"); +await elem.restore({ + row_pivots: ["Category"], + column_pivots: ["Region"], + columns: ["Sales", "Profit"], +}); +``` + +```python +widget = PerspectiveWidget() +widget.restore( + row_pivots=["Category"], + column_pivots=["Region"], + columns=["Sales", "Profit"] +) ```
- +
@@ -168,26 +183,35 @@ const view = await table.view({ ```python view = table.view( - aggregates={ - "a": "avg", - "b": "distinct count" - } + aggregates={ + "a": "avg", + "b": "distinct count" + } ) ``` #### Example -```html - - +```javascript +const elem = document.querySelector("perspective-viewer"); +await elem.restore({ + aggregates: {"Sales": "avg", "Profit", "median"}, + row_pivots: ["State", "City"], + columns: ["Sales", "Profit"] +}); +``` + +```python +widget = PerspectiveWidget() +widget.restore( + aggregates={"Sales": "avg", "Profit", "median"}, + row_pivots=["State", "City"], + columns=["Sales", "Profit"] +) ```
- +
@@ -210,13 +234,22 @@ view = table.view(columns=["a"]) #### Example -```html - - +```javascript +const elem = document.querySelector("perspective-viewer"); +await elem.restore({ + columns: ["Sales", "Profit", "Segment"], +}); +``` + +```python +widget = PerspectiveWidget() +widget.restore( + columns=["Sales", "Profit", "Segment"] +) ```
- +
@@ -242,9 +275,20 @@ view = table.view(sort=[["a", "asc"]]) #### Example -```html - - +```javascript +const elem = document.querySelector("perspective-viewer"); +await elem.restore({ + sort: [["Sales", "desc"]], + columns: ["Sales", "Profit"], +}); +``` + +```python +widget = PerspectiveWidget() +widget.restore( + sort=[["Sales", "desc"]], + columns=["Sales", "Profit"] +) ```
@@ -278,16 +322,24 @@ view = table.view(filter=[["a", "<", 100]]) Use the `filters` attribute on `` instead of `filter`. -```html - - +```javascript +const elem = document.querySelector("perspective-viewer"); +await elem.restore({ + columns: ["State", "Sales", "Profit"], + filter: [["State", "==", "Texas"]], +}); +``` + +```python +widget = PerspectiveWidget() +widget.restore( + columns=["Sales", "Profit"], + filter=[["State", "==", "Texas"]] +) ```
- +
@@ -301,24 +353,35 @@ Column" button in the side panel. A custom name can be added to an expression by making the first line a comment: ```javascript -// new column -"Sales" * "Profit" - 15; +const view = await table.view({ + expressions: ['"a" + "b"'], +}); ``` -To add expressions using the API: +```python +view = table.view(expressions=['"a" + "b"']) +``` #### Example -```html - - +```javascript +const elem = document.querySelector("perspective-viewer"); +await elem.restore({ + columns: ["new expression"], + expressions: ['//new expression\n"Sales" + "Profit" * 50 / sqrt("Sales")'], +}); +``` + +```python +widget = PerspectiveWidget() +widget.restore( + columns=["new_expression"], + expressions=["//new expression\n\"Sales\" + \"Profit\" * 50 / sqrt(\"Sales\")"] +) ```
- +
diff --git a/docs/pages/en/index.js b/docs/pages/en/index.js index c7238cbe6c..a45543c6ce 100755 --- a/docs/pages/en/index.js +++ b/docs/pages/en/index.js @@ -58,9 +58,8 @@ const Logo = props => ( const ProjectTitle = props => (

- - Streaming Analytics via WebAssembly - + {/* + */}

); @@ -283,25 +282,36 @@ const Features = props => ( const DESCRIPTION_TEXT = ` # What is Perspective? -Perspective is an interactive visualization component for large, real-time -datasets. Originally developed at J.P. Morgan, Perspective -makes it simple to build real-time & user configurable analytics entirely in the -browser, or in concert with Python and/or +Perspective is an interactive analytics and data visualization component, +which is especially well-suited for large and/or streaming datasets. +Originally developed at J.P. Morgan and open-sourced through the +[Fintech Open Source Foundation (FINOS)](https://www.finos.org/), +Perspective makes it simple to build user-configurable +analytics entirely in the browser, or in concert with Python and/or [Jupyterlab](https://jupyterlab.readthedocs.io/en/stable/). Use it to create reports, dashboards, notebooks and applications, with static -data or streaming updates via [Apache Arrow](https://arrow.apache.org/). As a -library, Perspective provides both: +data or streaming updates via [Apache Arrow](https://arrow.apache.org/). +### Features * A fast, memory efficient streaming query engine, written in C++ and compiled for both [WebAssembly](https://webassembly.org/) and - [Python](https://www.python.org/), with read/write/stream/virtual support for - [Apache Arrow](https://arrow.apache.org/). + [Python](https://www.python.org/). read/write/streaming for + [Apache Arrow](https://arrow.apache.org/), and a high-performance columnar + expression language based on [ExprTK](https://github.com/ArashPartow/exprtk). * A framework-agnostic User Interface - [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) - and [Jupyterlab](https://jupyterlab.readthedocs.io/en/stable/) Widget, via - WebWorker (WebAssembly) or virtually via WebSocket (Python/Node), and a suite of - Datagrid and [D3FC](https://d3fc.io/) Chart plugins. + [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements), + powered either in-browser via WebWorker (WebAssembly) or virtually via + WebSocket server (Python/Node), as well as a suite of Datagrid and + [D3FC](https://d3fc.io/) Chart plugins. + +* A [JupyterLab](https://jupyter.org/) widget and Python client library, for + interactive data analysis in a notebook, as well as _scalable_ production + [Voila](https://github.com/voila-dashboards/voila) and + [Holoviz](https://panel.holoviz.org/) applications. + + + `; const Description = props => ( @@ -347,14 +357,14 @@ const Jupyter = props => ( ); const JS_TEXT = ` -## Web Browser -Query-driven dashboards built on Perspective +## Web Browser (JavaScript) +Query-driven web dashboards built on Perspective.js [Custom Elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) -of JavaScript are completely user-configurable, and easy to integrate into any +are completely user-configurable, and easy to integrate into any web application framework. Using Perspective's simple _relational_ grammar, elements like -\`\` can be _symmetrically_ configured, by API or +\`\` can be _symmetrically_ configured, by API or through the User Interface, and emit dataset-aware Events for scriptable interactivity. Web Applications built in JavaScript with Perspective Custom Elements can be re-hydrated from their serialized state, driven @@ -363,7 +373,7 @@ virtual, server-side Python data with in-browser client data seamlessly, and independent data Views can be cross-filtered, duplicated, exported, stacked and saved. -To achieve Desktop-like performance in the Browser, Perspective for JavaScript +To achieve Desktop-like performance in the Browser, Perspective.js relies on [WebAssembly](https://webassembly.org/) for excellent _query calculation_ time, and [Apache Arrow](https://arrow.apache.org/) for its conservative _memory footprint_ and efficient _data serialization_. @@ -373,7 +383,7 @@ const Javascript = props => ( {[ { content: JS_TEXT, - image: imgUrl("demo_small.gif"), + image: imgUrl("demo_large.gif"), imageAlign: "left" } ]} diff --git a/docs/siteConfig.js b/docs/siteConfig.js index 6c57230b17..cf9a4c3ce9 100644 --- a/docs/siteConfig.js +++ b/docs/siteConfig.js @@ -17,6 +17,24 @@ const siteConfig = { secondaryColor: "#242526" }, users: [ + { + pinned: true, + image: "https://bl.ocks.org/texodus/raw/6b4dcebf65db4ebe4fe53a6de5ea0b48/thumbnail.png", + infoLink: "https://bl.ocks.org/texodus/6b4dcebf65db4ebe4fe53a6de5ea0b48", + caption: "Movies" + }, + { + pinned: true, + image: "https://texodus.github.io/nypd-ccrb/preview.png", + infoLink: "https://texodus.github.io/nypd-ccrb/", + caption: "CCRB" + }, + { + pinned: true, + image: "https://perspective.finos.org/img/mtg_thumbnail.png", + infoLink: "https://texodus.github.io/mtg-perspective/?seasons-in-the-abyss-67", + caption: "Magic" + }, { pinned: true, image: "https://bl.ocks.org/texodus/raw/803de90736a3641ad91c5c7a1b49d0a7/thumbnail.png", @@ -79,13 +97,13 @@ const siteConfig = { theme: "atom-one-light" }, scripts: ["js/fonts.js", "https://buttons.github.io/buttons.js", "js/index.js"], - // stylesheets: [ - // "https://fonts.googleapis.com/css?family=Material+Icons", - // "https://fonts.googleapis.com/css?family=Open+Sans", - // "https://fonts.googleapis.com/css?family=Public+Sans", - // "https://fonts.googleapis.com/css?family=Roboto+Mono", - // "https://fonts.googleapis.com/css2?family=Orbitron:wght@900" - // ], + stylesheets: [ + "https://fonts.googleapis.com/css?family=Material+Icons", + "https://fonts.googleapis.com/css?family=Open+Sans", + "https://fonts.googleapis.com/css?family=Public+Sans", + "https://fonts.googleapis.com/css?family=Roboto+Mono", + "https://fonts.googleapis.com/css2?family=Orbitron:wght@900" + ], onPageNav: "separate", ogImage: "img/perspective.png", twitterImage: "img/perspective.png" diff --git a/docs/static/css/custom.css b/docs/static/css/custom.css index dbd535a123..ccc137dbd6 100644 --- a/docs/static/css/custom.css +++ b/docs/static/css/custom.css @@ -55,7 +55,7 @@ body { } .imageAlignSide .blockImage > * { - box-shadow: 0 5px 5px rgba(0,0,0,0.2); + /* box-shadow: 0 5px 5px rgba(0,0,0,0.2); */ } .titleViewer { From 7d2557777d211e14c0bfcb27147eb9bb13ab285d Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Sat, 9 Oct 2021 00:12:37 -0400 Subject: [PATCH 05/10] Fix datagrid plugin crash when restore() before draw() --- packages/perspective-viewer-datagrid/src/js/plugin.js | 8 +++++++- .../src/js/regular_table_handlers.js | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/perspective-viewer-datagrid/src/js/plugin.js b/packages/perspective-viewer-datagrid/src/js/plugin.js index e1cc773303..be095f21a2 100644 --- a/packages/perspective-viewer-datagrid/src/js/plugin.js +++ b/packages/perspective-viewer-datagrid/src/js/plugin.js @@ -158,7 +158,13 @@ customElements.define( } const datagrid = this.datagrid; - datagrid._resetAutoSize(); + try { + datagrid._resetAutoSize(); + } catch (e) { + // Do nothing; this may fail if no auto size info has been read. + // TODO fix this regular-table API + } + this._restore_column_size_overrides(overrides, true); datagrid[PLUGIN_SYMBOL] = token; } diff --git a/packages/perspective-viewer-datagrid/src/js/regular_table_handlers.js b/packages/perspective-viewer-datagrid/src/js/regular_table_handlers.js index bebb26236b..0784acb243 100644 --- a/packages/perspective-viewer-datagrid/src/js/regular_table_handlers.js +++ b/packages/perspective-viewer-datagrid/src/js/regular_table_handlers.js @@ -646,7 +646,10 @@ export async function createModel(regular, table, view, extend = {}) { // Re-use div factory model._div_factory = model._div_factory || new ElemFactory("div"); - regular.setDataListener(dataListener.bind(model, regular)); + regular.setDataListener(dataListener.bind(model, regular), { + virtual_mode: regular.parentElement.virtual_mode || "both", + }); + return model; } From 843dc278557ca9c7b1e6e1554bb1dfd930852c47 Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Sat, 9 Oct 2021 00:14:23 -0400 Subject: [PATCH 06/10] Fix rust project CI build error --- rust/perspective-viewer/Cargo.lock | 1 - rust/perspective-viewer/Cargo.toml | 8 +- rust/perspective-viewer/README.md | 68 ++++---- rust/perspective-viewer/package.json | 11 +- rust/perspective-viewer/rollup.config.js | 202 ++++++++++------------- rust/perspective-viewer/src/rust/lib.rs | 6 - rust/perspective-viewer/src/ts/init.ts | 1 - 7 files changed, 129 insertions(+), 168 deletions(-) diff --git a/rust/perspective-viewer/Cargo.lock b/rust/perspective-viewer/Cargo.lock index d4f808a6cb..9f79f3ae63 100644 --- a/rust/perspective-viewer/Cargo.lock +++ b/rust/perspective-viewer/Cargo.lock @@ -737,7 +737,6 @@ dependencies = [ "async-trait", "base64", "chrono", - "console_error_panic_hook", "derivative", "flate2", "futures", diff --git a/rust/perspective-viewer/Cargo.toml b/rust/perspective-viewer/Cargo.toml index 5ddab7472c..e1ea268fb8 100644 --- a/rust/perspective-viewer/Cargo.toml +++ b/rust/perspective-viewer/Cargo.toml @@ -12,7 +12,7 @@ path = "src/rust/lib.rs" [features] new_column_selector = [] -default = ["console_error_panic_hook", "new_column_selector"] +default = ["new_column_selector"] [dependencies] async-std = "1.9.0" @@ -32,12 +32,6 @@ wasm-bindgen = { version = "=0.2.74", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4.20" yew = { git = "https://github.com/yewstack/yew", rev = "f94487364f6eb1c7862e48f7c82ee4122ae8e845" } -# The `console_error_panic_hook` crate provides better debugging of panics by -# logging them with `console.error`. This is great for development, but requires -# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for -# code size when deploying. -console_error_panic_hook = { version = "0.1.6", optional = true } - # `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size # compared to the default allocator's ~10K. It is slower than the default # allocator, however. diff --git a/rust/perspective-viewer/README.md b/rust/perspective-viewer/README.md index bc1aec83d5..a3acb6b110 100644 --- a/rust/perspective-viewer/README.md +++ b/rust/perspective-viewer/README.md @@ -39,7 +39,7 @@ relevent DOM method e.g. `document.createElement("perspective-viewer")` or #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:16](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L16) +[rust/perspective-viewer/src/ts/viewer.ts:16](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L16) # Class: PerspectiveViewerElement @@ -131,7 +131,7 @@ A `Promise` which resolves to a `perspective.Table` #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:158](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L158) +[rust/perspective-viewer/src/ts/viewer.ts:158](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L158) ___ @@ -161,7 +161,7 @@ my_viewer.load(tbl); | Name | Type | | :------ | :------ | -| `table` | `Promise`<`Table`\> | +| `table` | `Table` \| `Promise`<`Table`\> | #### Returns @@ -173,7 +173,7 @@ rendered. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:115](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L115) +[rust/perspective-viewer/src/ts/viewer.ts:115](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L115) ___ @@ -199,7 +199,7 @@ await viewer.reset(); #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:276](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L276) +[rust/perspective-viewer/src/ts/viewer.ts:276](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L276) ___ @@ -253,7 +253,7 @@ rendered. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:201](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L201) +[rust/perspective-viewer/src/ts/viewer.ts:201](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L201) ___ @@ -283,7 +283,7 @@ a serialized element in the chosen format. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:228](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L228) +[rust/perspective-viewer/src/ts/viewer.ts:228](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L228) ▸ **save**(`format`): `Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> @@ -299,7 +299,7 @@ a serialized element in the chosen format. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:229](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L229) +[rust/perspective-viewer/src/ts/viewer.ts:229](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L229) ▸ **save**(`format`): `Promise`<`ArrayBuffer`\> @@ -315,7 +315,7 @@ a serialized element in the chosen format. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:230](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L230) +[rust/perspective-viewer/src/ts/viewer.ts:230](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L230) ▸ **save**(`format`): `Promise`<`string`\> @@ -331,7 +331,7 @@ a serialized element in the chosen format. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:231](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L231) +[rust/perspective-viewer/src/ts/viewer.ts:231](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L231) ___ @@ -356,7 +356,7 @@ An `Array` of the plugin instances for this #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:448](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L448) +[rust/perspective-viewer/src/ts/viewer.ts:448](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L448) ___ @@ -387,7 +387,7 @@ The active or requested plugin instance. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:431](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L431) +[rust/perspective-viewer/src/ts/viewer.ts:431](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L431) ___ @@ -416,7 +416,7 @@ customElements.get("perspective-viewer").registerPlugin("my-plugin"); #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:87](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L87) +[rust/perspective-viewer/src/ts/viewer.ts:87](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L87) ___ @@ -452,7 +452,7 @@ button.addEventListener("click", async () => { #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:325](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L325) +[rust/perspective-viewer/src/ts/viewer.ts:325](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L325) ___ @@ -474,7 +474,7 @@ Download this element's data as a CSV file. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:302](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L302) +[rust/perspective-viewer/src/ts/viewer.ts:302](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L302) ___ @@ -509,7 +509,7 @@ await viewer.toggleConfig(); #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:411](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L411) +[rust/perspective-viewer/src/ts/viewer.ts:411](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L411) ___ @@ -531,7 +531,7 @@ bound to. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:290](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L290) +[rust/perspective-viewer/src/ts/viewer.ts:290](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L290) ___ @@ -563,7 +563,7 @@ pending state changes have been applied and rendered. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:259](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L259) +[rust/perspective-viewer/src/ts/viewer.ts:259](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L259) ___ @@ -598,7 +598,7 @@ A promise which resolves to the current edit port. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:366](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L366) +[rust/perspective-viewer/src/ts/viewer.ts:366](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L366) ___ @@ -628,7 +628,7 @@ finished rendering. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:137](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L137) +[rust/perspective-viewer/src/ts/viewer.ts:137](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L137) ___ @@ -648,7 +648,7 @@ as SVG and Canvas attributes. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:339](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L339) +[rust/perspective-viewer/src/ts/viewer.ts:339](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L339) ___ @@ -678,7 +678,7 @@ await viewer.setThrottle(1000); #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:387](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/viewer.ts#L387) +[rust/perspective-viewer/src/ts/viewer.ts:387](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L387) # Interface: IPerspectiveViewerPlugin @@ -762,7 +762,7 @@ logic. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:80](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L80) +[rust/perspective-viewer/src/ts/plugin.ts:80](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L80) ___ @@ -784,7 +784,7 @@ identical behavior to 1. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:71](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L71) +[rust/perspective-viewer/src/ts/plugin.ts:71](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L71) ___ @@ -802,7 +802,7 @@ display name for this plugin in the `` UI. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:52](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L52) +[rust/perspective-viewer/src/ts/plugin.ts:52](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L52) ___ @@ -821,7 +821,7 @@ on column state), leaving existing columns alone. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:60](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L60) +[rust/perspective-viewer/src/ts/plugin.ts:60](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L60) ## Methods @@ -847,7 +847,7 @@ async clear(): Promise { #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:124](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L124) +[rust/perspective-viewer/src/ts/plugin.ts:124](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L124) ___ @@ -863,7 +863,7 @@ Free any resources acquired by this plugin and prepare to be deleted. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:159](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L159) +[rust/perspective-viewer/src/ts/plugin.ts:159](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L159) ___ @@ -895,7 +895,7 @@ async draw(view: perspective.View): Promise { #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:95](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L95) +[rust/perspective-viewer/src/ts/plugin.ts:95](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L95) ___ @@ -912,7 +912,7 @@ and the underlying data has not. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:130](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L130) +[rust/perspective-viewer/src/ts/plugin.ts:130](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L130) ___ @@ -934,7 +934,7 @@ Restore this plugin to a state previously returned by `save()`. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:154](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L154) +[rust/perspective-viewer/src/ts/plugin.ts:154](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L154) ___ @@ -951,7 +951,7 @@ plugins which read CSS styles via `window.getComputedStyle()`. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:136](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L136) +[rust/perspective-viewer/src/ts/plugin.ts:136](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L136) ___ @@ -975,7 +975,7 @@ reload. For example, `@finos/perspective-viewer-d3fc` uses #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:149](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L149) +[rust/perspective-viewer/src/ts/plugin.ts:149](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L149) ___ @@ -1006,6 +1006,6 @@ async update(view: perspective.View): Promise { #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:109](https://github.com/finos/perspective/blob/21eb6e630/rust/perspective-viewer/src/ts/plugin.ts#L109) +[rust/perspective-viewer/src/ts/plugin.ts:109](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L109) diff --git a/rust/perspective-viewer/package.json b/rust/perspective-viewer/package.json index 1347af427d..3858abfbd6 100644 --- a/rust/perspective-viewer/package.json +++ b/rust/perspective-viewer/package.json @@ -1,7 +1,7 @@ { "name": "@finos/perspective-viewer", "version": "1.0.0-rc.2", - "description": "A regular `
`, for an async and virtual data model.", + "description": "The `` Custom Element, frontend for Perspective.js", "repository": { "type": "git", "url": "https://github.com/finos/perspective" @@ -19,10 +19,13 @@ "types": "dist/esm/index.d.ts", "scripts": { "build:wasm": "wasm-pack build --out-dir dist/pkg --target web && rm dist/pkg/package.json && rm dist/pkg/.gitignore", - "build:rollup": "rollup --config rollup.config.js", + "build:rollup:js": "rollup --config rollup.config.js", + "build:rollup:css": "rollup --config rollup.config.js --config-inline-css", "build:webpack:inline": "webpack --color --config webpack.inline.config.js", "build:webpack:umd": "webpack --color --config webpack.config.js", - "build": "npm-run-all build:rollup build:wasm build:webpack:* && cpx 'src/less/*' dist/less", + "build:webpack": "npm-run-all -p build:webpack:umd build:webpack:inline", + "build:less": "cpx 'src/less/*' dist/less", + "build": "npm-run-all build:rollup:css build:wasm build:rollup:js build:webpack build:less", "watch:wasm": "cargo watch -i .gitignore -i \"pkg/*\" -i \"src/js/*\" -s \"yarn build:wasm\"", "watch:rollup": "rollup --watch --config rollup.config.js", "watch:webpack": "webpack --watch --color --config webpack.config.js", @@ -33,7 +36,7 @@ "docs": "npm-run-all docs:build docs:concat docs:deploy", "docs:build": "typedoc --hideBreadcrumbs --out dist/docs --readme none --excludePrivate src/ts/index.ts", "docs:concat": "node ./docs.js", - "docs:deploy": "(echo \"---\nid: perspective\ntitle: perspective-viewer API\n---\n\n\"; cat README.md) > ../../docs/obj/perspective-viewer.md", + "docs:deploy": "(echo \"---\nid: perspective-viewer\ntitle: perspective-viewer API\n---\n\n\"; cat README.md) > ../../docs/obj/perspective-viewer.md", "fix": "yarn lint --fix && cargo fmt", "lint": "eslint src/ts", "test:build:rust": "cpx ../../packages/perspective/dist/umd/perspective.inline.js dist/pkg/", diff --git a/rust/perspective-viewer/rollup.config.js b/rust/perspective-viewer/rollup.config.js index 2deb85908e..ae9f4eca4d 100644 --- a/rust/perspective-viewer/rollup.config.js +++ b/rust/perspective-viewer/rollup.config.js @@ -5,124 +5,96 @@ import typescript from "@rollup/plugin-typescript"; import path from "path"; import fs from "fs"; -export default () => { - return [ - { - input: `src/less/viewer.less`, - output: { - dir: "dist/css", - }, - plugins: [ - postcss({ - inject: false, - extract: path.resolve(`dist/css/viewer.css`), - minimize: {preset: "lite"}, - }), - ], - }, - { - input: `src/less/column-style.less`, - output: { - dir: "dist/css", - }, - plugins: [ - postcss({ - inject: false, - extract: path.resolve(`dist/css/column-style.css`), - minimize: {preset: "lite"}, - }), - ], +export default function (options) { + if (options["config-inline-css"]) { + return [ + ...[ + "viewer", + "column-style", + "filter-dropdown", + "expression-editor", + ].map(create_inline_css), + ]; + } else { + return [ + ...["index", "monaco"].map(create_bundle), + ...THEMES.map(create_theme), + ]; + } +} + +const THEMES = fs.readdirSync(path.resolve(__dirname, "src", "themes")); + +function create_inline_css(name) { + return { + input: `src/less/${name}.less`, + output: { + dir: "dist/css", }, - { - input: `src/less/filter-dropdown.less`, - output: { - dir: "dist/css", - }, - plugins: [ - postcss({ - inject: false, - extract: path.resolve(`dist/css/filter-dropdown.css`), - minimize: {preset: "lite"}, - }), - ], + plugins: [ + postcss({ + inject: false, + extract: path.resolve(`dist/css/${name}.css`), + minimize: {preset: "lite"}, + }), + ], + }; +} + +function create_bundle(name) { + return { + input: `src/ts/${name}.ts`, + external: [/pkg/, /node_modules/, /monaco\-editor/, /^[a-zA-Z\@]/], + output: { + sourcemap: true, + dir: "dist/esm/", }, - { - input: `src/less/expression-editor.less`, - output: { - dir: "dist/css", - }, - plugins: [ - postcss({ - inject: false, - extract: path.resolve(`dist/css/expression-editor.css`), - minimize: {preset: "lite"}, - }), - ], + plugins: [ + typescript({tsconfig: "./tsconfig.json"}), + filesize(), + postcss({ + inject: false, + sourceMap: true, + minimize: {mergeLonghand: false}, + }), + sourcemaps(), + ], + watch: { + clearScreen: false, }, - ...["index", "monaco"].map((name) => ({ - input: `src/ts/${name}.ts`, - external: [/pkg/, /node_modules/, /monaco\-editor/, /^[a-zA-Z\@]/], - output: { - sourcemap: true, - dir: "dist/esm/", - }, - plugins: [ - typescript({tsconfig: "./tsconfig.json"}), - filesize(), - postcss({ - inject: false, - sourceMap: true, - minimize: {mergeLonghand: false}, - }), - sourcemaps(), - ], - watch: { - clearScreen: false, - }, - })), - ...generate_themes(), - ]; -}; - -const THEMES = fs.readdirSync(path.resolve(__dirname, "src", "themes")); + }; +} -function generate_themes() { - function reducer(key, val) { - return { - input: `${val}`, - output: { - dir: "dist/umd", - }, - plugins: [ - { - name: "remove-js-after-hook", - resolveId(source) { - return null; - }, - buildEnd: () => { - fs.rm( - path.resolve(__dirname, "dist", "css", `${key}.js`), - () => {} - ); - }, - load(id) { - return null; - }, +function create_theme(theme) { + const key = theme.replace(".less", ""); + const val = path.resolve(__dirname, "src", "themes", theme); + return { + input: `${val}`, + output: { + dir: "dist/umd", + }, + plugins: [ + { + name: "remove-js-after-hook", + resolveId(source) { + return null; }, - postcss({ - inject: false, - extract: path.resolve(`dist/umd/${key}.css`), - sourceMap: false, - minimize: false, - }), - ], - }; - } - - return THEMES.map((theme) => - reducer( - theme.replace(".less", ""), - path.resolve(__dirname, "src", "themes", theme) - ) - ); + buildEnd: () => { + fs.rm( + path.resolve(__dirname, "dist", "css", `${key}.js`), + () => {} + ); + }, + load(id) { + return null; + }, + }, + postcss({ + inject: false, + extract: path.resolve(`dist/umd/${key}.css`), + sourceMap: false, + minimize: false, + }), + ], + }; } diff --git a/rust/perspective-viewer/src/rust/lib.rs b/rust/perspective-viewer/src/rust/lib.rs index 5ce62e1137..f264f14e04 100644 --- a/rust/perspective-viewer/src/rust/lib.rs +++ b/rust/perspective-viewer/src/rust/lib.rs @@ -26,12 +26,6 @@ use wasm_bindgen::prelude::*; #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; -#[wasm_bindgen] -pub fn set_panic_hook() { - #[cfg(feature = "console_error_panic_hook")] - console_error_panic_hook::set_once(); -} - #[wasm_bindgen] pub fn register_plugin(name: &str) { use crate::renderer::registry::*; diff --git a/rust/perspective-viewer/src/ts/init.ts b/rust/perspective-viewer/src/ts/init.ts index a040e2da0d..7b24c83ed2 100644 --- a/rust/perspective-viewer/src/ts/init.ts +++ b/rust/perspective-viewer/src/ts/init.ts @@ -21,7 +21,6 @@ window.addEventListener("unhandledrejection", (event) => { async function init_wasm({default: wasm_module}): Promise { await init(wasm_module); - internal.set_panic_hook(); return internal; } From 9b615a24bb7fec5b2d1bf5823221f54509b096f0 Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Sat, 9 Oct 2021 00:15:31 -0400 Subject: [PATCH 07/10] Fix perspective-viewer API quirks --- .../src/less/column-style.less | 2 +- .../src/less/expression-editor.less | 2 +- .../src/less/filter-dropdown.less | 2 +- .../src/rust/components/filter_item.rs | 57 ++++++++++--------- .../src/rust/custom_elements/viewer.rs | 8 ++- .../src/rust/session/metadata.rs | 3 +- rust/perspective-viewer/src/rust/utils/mod.rs | 8 +++ rust/perspective-viewer/src/ts/viewer.ts | 4 +- 8 files changed, 53 insertions(+), 33 deletions(-) diff --git a/rust/perspective-viewer/src/less/column-style.less b/rust/perspective-viewer/src/less/column-style.less index 2bdb418edd..2cd22109a4 100644 --- a/rust/perspective-viewer/src/less/column-style.less +++ b/rust/perspective-viewer/src/less/column-style.less @@ -10,7 +10,7 @@ @import "./radio-list.less"; :host { - position: absolute; + position: fixed; z-index: 10000; padding: 6px; outline: none; diff --git a/rust/perspective-viewer/src/less/expression-editor.less b/rust/perspective-viewer/src/less/expression-editor.less index f5b609b9bd..2c24965d95 100644 --- a/rust/perspective-viewer/src/less/expression-editor.less +++ b/rust/perspective-viewer/src/less/expression-editor.less @@ -10,7 +10,7 @@ @import "./monaco.less"; :host { - position: absolute; + position: fixed; z-index: 10000; outline: none; font-family: "Open Sans"; diff --git a/rust/perspective-viewer/src/less/filter-dropdown.less b/rust/perspective-viewer/src/less/filter-dropdown.less index af25aa1187..331db6913c 100644 --- a/rust/perspective-viewer/src/less/filter-dropdown.less +++ b/rust/perspective-viewer/src/less/filter-dropdown.less @@ -8,7 +8,7 @@ */ :host { - position: absolute; + position: fixed; z-index: 10000; outline: none; font-family: "Open Sans"; diff --git a/rust/perspective-viewer/src/rust/components/filter_item.rs b/rust/perspective-viewer/src/rust/components/filter_item.rs index 98fc7ffef8..6ecfc9c9c2 100644 --- a/rust/perspective-viewer/src/rust/components/filter_item.rs +++ b/rust/perspective-viewer/src/rust/components/filter_item.rs @@ -62,21 +62,20 @@ impl FilterItemProperties { /// Does this filter item get a "suggestions" auto-complete modal? fn is_suggestable(&self) -> bool { (self.filter.1 == FilterOp::EQ || self.filter.1 == FilterOp::NE) - && self.get_filter_type() == Type::String + && self.get_filter_type() == Some(Type::String) } /// Get this filter's type, e.g. the type of the column. - fn get_filter_type(&self) -> Type { + fn get_filter_type(&self) -> Option { self.session .metadata() .get_column_table_type(&self.filter.0) - .unwrap() } // Get the string value, suitable for the `value` field of a `FilterItems`'s // ``. fn get_filter_input(&self) -> Option { - let filter_type = self.get_filter_type(); + let filter_type = self.get_filter_type()?; match (&filter_type, &self.filter.2) { (Type::Date, FilterTerm::Scalar(Scalar::Float(x))) | (Type::Date, FilterTerm::Scalar(Scalar::DateTime(x))) => { @@ -120,7 +119,7 @@ impl FilterItemProperties { /// Get the allowed `FilterOp`s for this filter. fn get_filter_ops(&self) -> Vec { match self.get_filter_type() { - Type::String => vec![ + Some(Type::String) => vec![ FilterOp::EQ, FilterOp::NE, FilterOp::GT, @@ -134,12 +133,12 @@ impl FilterItemProperties { FilterOp::IsNotNull, FilterOp::IsNull, ], - Type::Bool => vec![ + Some(Type::Bool) => vec![ FilterOp::EQ, FilterOp::IsNull, FilterOp::IsNotNull ], - _ => vec![ + Some(_) => vec![ FilterOp::EQ, FilterOp::NE, FilterOp::GT, @@ -149,6 +148,7 @@ impl FilterItemProperties { FilterOp::IsNotNull, FilterOp::IsNull, ], + _ => vec![] } } @@ -184,24 +184,24 @@ impl FilterItemProperties { ); } _ => match self.get_filter_type() { - Type::String => { + Some(Type::String) => { filter_item.2 = FilterTerm::Scalar(Scalar::String(val)); } - Type::Integer => { + Some(Type::Integer) => { if val.is_empty() { filter_item.2 = FilterTerm::Scalar(Scalar::Null); } else if let Ok(num) = val.parse::() { filter_item.2 = FilterTerm::Scalar(Scalar::Float(num.floor())); } } - Type::Float => { + Some(Type::Float) => { if val.is_empty() { filter_item.2 = FilterTerm::Scalar(Scalar::Null); } else if let Ok(num) = val.parse::() { filter_item.2 = FilterTerm::Scalar(Scalar::Float(num)); } } - Type::Date => { + Some(Type::Date) => { filter_item.2 = FilterTerm::Scalar(match NaiveDate::parse_from_str( &val, "%Y-%m-%d", ) { @@ -212,7 +212,7 @@ impl FilterItemProperties { _ => Scalar::Null, }) } - Type::Datetime => { + Some(Type::Datetime) => { filter_item.2 = FilterTerm::Scalar( match NaiveDateTime::parse_from_str( &val, @@ -228,12 +228,15 @@ impl FilterItemProperties { }, ) } - Type::Bool => { + Some(Type::Bool) => { filter_item.2 = FilterTerm::Scalar(match val.as_str() { "true" => Scalar::Bool(true), _ => Scalar::Bool(false), }); } + + // shouldn't be reachable .. + _ => {} }, } @@ -255,7 +258,7 @@ impl Component for FilterItem { fn create(props: FilterItemProperties, link: ComponentLink) -> Self { let input = props.get_filter_input().unwrap_or_else(|| "".to_owned()); let input_ref = NodeRef::default(); - if props.get_filter_type() == Type::Bool { + if let Some(Type::Bool) = props.get_filter_type() { props.update_filter_input(input.clone()); } @@ -266,7 +269,7 @@ impl Component for FilterItem { match msg { FilterItemMsg::FilterInput(column, input) => { let target = self.input_ref.cast::().unwrap(); - let input = if self.props.get_filter_type() == Type::Bool { + let input = if let Some(Type::Bool) = self.props.get_filter_type() { if target.checked() { "true".to_owned() } else { @@ -344,8 +347,7 @@ impl Component for FilterItem { .props .session .metadata() - .get_column_table_type(&column) - .unwrap(); + .get_column_table_type(&column); let select = self.link.callback(FilterItemMsg::FilterOpSelect); @@ -385,13 +387,13 @@ impl Component for FilterItem { }); let type_class = match col_type { - Type::Float | Type::Integer => "num-filter", - Type::String => "string-filter", + Some(Type::Float) | Some(Type::Integer) => "num-filter", + Some(Type::String) => "string-filter", _ => "", }; let input_elem = match col_type { - Type::Integer => html! { + Some(Type::Integer) => html! { }, - Type::Float => html! { + Some(Type::Float) => html! { }, - Type::String => html! { + Some(Type::String) => html! { }, - Type::Date => html! { + Some(Type::Date) => html! { }, - Type::Datetime => html! { + Some(Type::Datetime) => html! { }, - Type::Bool => { + Some(Type::Bool) => { html! { } }, + None => { + html! {} + } }; let filter_ops = self @@ -493,7 +498,7 @@ impl Component for FilterItem { { if matches!(&filter.1, FilterOp::IsNotNull | FilterOp::IsNull) { html! {} - } else if col_type == Type::Bool { + } else if let Some(Type::Bool) = col_type { html! { { input_elem } } diff --git a/rust/perspective-viewer/src/rust/custom_elements/viewer.rs b/rust/perspective-viewer/src/rust/custom_elements/viewer.rs index 9691f4a2e6..f876117201 100644 --- a/rust/perspective-viewer/src/rust/custom_elements/viewer.rs +++ b/rust/perspective-viewer/src/rust/custom_elements/viewer.rs @@ -121,8 +121,14 @@ impl PerspectiveViewerElement { pub fn connected_callback(&self) {} /// Loads a promise to a `JsPerspectiveTable` in this viewer. - pub fn js_load(&self, table: js_sys::Promise) -> js_sys::Promise { + pub fn js_load(&self, table: JsValue) -> js_sys::Promise { assert!(!table.is_undefined()); + let table = if let Ok(table) = table.clone().dyn_into::() { + table + } else { + js_sys::Promise::resolve(&table) + }; + let mut config = ViewConfigUpdate::default(); self.session .set_update_column_defaults(&mut config, &self.renderer.metadata()); diff --git a/rust/perspective-viewer/src/rust/session/metadata.rs b/rust/perspective-viewer/src/rust/session/metadata.rs index 272b53a3ea..52b647dfe4 100644 --- a/rust/perspective-viewer/src/rust/session/metadata.rs +++ b/rust/perspective-viewer/src/rust/session/metadata.rs @@ -81,11 +81,10 @@ impl SessionMetadata { pub(super) fn update_expressions( &mut self, - // table: &JsPerspectiveTable, valid_recs: &JsPerspectiveValidatedExpressions, ) -> Result, JsValue> { if js_sys::Object::keys(&valid_recs.errors()).length() > 0 { - panic!("Wormfood!"); + return Err(JsValue::from("Expressions invalid")); } let expression_alias = valid_recs diff --git a/rust/perspective-viewer/src/rust/utils/mod.rs b/rust/perspective-viewer/src/rust/utils/mod.rs index 50624e6b94..34744c2b62 100644 --- a/rust/perspective-viewer/src/rust/utils/mod.rs +++ b/rust/perspective-viewer/src/rust/utils/mod.rs @@ -68,3 +68,11 @@ macro_rules! clone { $(let $x = $x.clone();)* }; } + +#[macro_export] +macro_rules! js_log { + ($x:expr $(, $y:expr)*) => { + web_sys::console::log_1(&format!($x $(, $y)*).into()); + }; +} + diff --git a/rust/perspective-viewer/src/ts/viewer.ts b/rust/perspective-viewer/src/ts/viewer.ts index ed936a95d4..b48a29158f 100644 --- a/rust/perspective-viewer/src/ts/viewer.ts +++ b/rust/perspective-viewer/src/ts/viewer.ts @@ -112,7 +112,9 @@ export class PerspectiveViewerElement extends HTMLElement { * my_viewer.load(tbl); * ``` */ - async load(table: Promise): Promise { + async load( + table: Promise | perspective.Table + ): Promise { await this.load_wasm(); await this.instance.js_load(table); } From 1387ed622cdfd306849abd0939fe1d2f2966e912 Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Sat, 9 Oct 2021 19:51:45 -0400 Subject: [PATCH 08/10] Update README --- README.md | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f082442a66..056aa59041 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,36 @@ [![Build Status](https://dev.azure.com/finosfoundation/perspective/_apis/build/status/finos.perspective?branchName=master)](https://dev.azure.com/finosfoundation/perspective/_build/latest?definitionId=1&branchName=master) [![FINOS - Active](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-active.svg)](https://finosfoundation.atlassian.net/wiki/display/FINOS/Active) -Perspective is an interactive visualization component for large, real-time -datasets. Originally developed at J.P. Morgan, Perspective makes it simple to -build user-configurable analytics entirely in the browser, or in concert with -Python and/or [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/). + +Perspective is an interactive analytics and data visualization component, +which is especially well-suited for large and/or streaming datasets. +Originally developed at J.P. Morgan and open-sourced through the +[Fintech Open Source Foundation (FINOS)](https://www.finos.org/), +Perspective makes it simple to build user-configurable +analytics entirely in the browser, or in concert with Python and/or +[Jupyterlab](https://jupyterlab.readthedocs.io/en/stable/). Use it to create reports, dashboards, notebooks and applications, with static -data or streaming updates via [Apache Arrow](https://arrow.apache.org/). As a -library, Perspective provides both: +data or streaming updates via [Apache Arrow](https://arrow.apache.org/). + +* A fast, memory efficient streaming query engine, written in + C++ and compiled for both [WebAssembly](https://webassembly.org/) and + [Python](https://www.python.org/). read/write/streaming for + [Apache Arrow](https://arrow.apache.org/), and a high-performance columnar + expression language based on [ExprTK](https://github.com/ArashPartow/exprtk). -- A fast, memory efficient streaming query engine, written in C++ and compiled for both [WebAssembly](https://webassembly.org/) and [Python](https://www.python.org/), with read/write/stream/virtual support for [Apache Arrow](https://arrow.apache.org/). +* A framework-agnostic User Interface + [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements), + powered either in-browser via WebWorker (WebAssembly) or virtually via + WebSocket server (Python/Node), as well as a suite of Datagrid and + [D3FC](https://d3fc.io/) Chart plugins. -- A framework-agnostic User Interface [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) and [Jupyterlab](https://jupyterlab.readthedocs.io/en/stable/) Widget, via WebWorker (WebAssembly) or virtually via WebSocket (Python/Node), and a suite of Datagrid and [D3FC](https://d3fc.io/) Chart plugins. +* A [JupyterLab](https://jupyter.org/) widget and Python client library, for + interactive data analysis in a notebook, as well as _scalable_ production + [Voila](https://github.com/voila-dashboards/voila) and + [Holoviz](https://panel.holoviz.org/) applications. - +
+ ## Examples From da6c8585589d1cb30c9bee45f03b9b6ed5a6298a Mon Sep 17 00:00:00 2001 From: Jun Tan Date: Mon, 11 Oct 2021 13:56:08 -0400 Subject: [PATCH 09/10] spellcheck --- docs/md/js.md | 39 +++++++++++++++++++++++---------------- docs/md/view.md | 4 +--- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/docs/md/js.md b/docs/md/js.md index 3efef3201a..5d3a1b23bc 100644 --- a/docs/md/js.md +++ b/docs/md/js.md @@ -41,7 +41,7 @@ correctly form your existing Webpack configuration. When importing `perspective` from NPM modules for a browser application, you should use `@finos/perspective-webpack-plugin` to manage the `.worker.js` and `.wasm` assets for you. Doing so will improve your application's initial load -performance, the plugin-compiled version of Perspective .. +performance, the plugin-compiled version of Perspective: - Downloads `.wasm` and `.js` assets in parallel. - Compiles `.wasm` incrementally via [streaming instantiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming). @@ -65,7 +65,7 @@ module.exports = { ``` `@finos/perspective-viewer` has a dependence on [`monaco-editor`](https://microsoft.github.io/monaco-editor/), -which itself depends on severl CSS assets. If your webpack config uses a +which itself depends on several CSS assets. If your webpack config uses a loader for `"*.css"` or similar, you may need to exclude `monaco-editor` from this loader to prevent double-encoding: @@ -286,9 +286,16 @@ return a `promise` for the calculated data: Via `Promise` ```javascript +// an array of objects representing each row view.to_json().then((json) => console.log(json)); + +// an object of arrays representing each column view.to_columns().then((json) => console.log(json)); + +// a CSV-formatted string view.to_csv().then((csv) => console.log(csv)); + +// an Arrow binary serialized to ArrayBuffer view.to_arrow().then((arrow) => console.log(arrow)); ``` @@ -315,11 +322,11 @@ In order to prevent memory leaks and reclaim the memory associated with a Perspective `table()` or `view()`, you must call the `delete()` method: ```javascript -view.delete(); +await view.delete(); // This method will throw an exception if there are still `view()`s depending // on this `table()`! -table.delete(); +await table.delete(); ``` ## `perspective-viewer` web component @@ -393,7 +400,7 @@ _*index.html*_ >
``` -If you choose not to bundle the themes yourself, they are available through the +If you choose not to bundle the themes yourself, they are available through [unpkg.com](https://unpkg.com/@finos/perspective-viewer/dist/umd/). These can be directly linked in your HTML file: @@ -426,20 +433,20 @@ when the underlying `table()` is updated, but `table.delete()` will fail until all `perspective-viewer` instances referencing it are also deleted: ```javascript -var view1 = document.getElementById("view1"); -var view2 = document.getElementById("view2"); +const viewer1 = document.getElementById("viewer1"); +const viewer2 = document.getElementById("viewer2"); -// Create a new Web Worker -var worker = perspective.worker(); +// Create a new WebWorker +const worker = perspective.worker(); // Create a table in this worker -var table = await worker.table(data); +const table = await worker.table(data); -// Load the same table in 2 different s -view1.load(table); -view2.load(table); +// Load the same table in 2 different elements +viewer1.load(table); +viewer2.load(table); -// Both `view1` and `view2` will reflect this update +// Both `viewer1` and `viewer2` will reflect this update table.update([{ x: 5, y: "e", z: true }]); ``` @@ -640,7 +647,7 @@ await elem.restore({ expressions: ['"Sales" + 100'], }); -// ERROR if the column does not exist in the schema or expressions .. +// ERROR if the column does not exist in the schema or expressions // await elem.restore({columns: ["\"Sales\" + 100"], expressions: []}); // Add a filter @@ -661,7 +668,7 @@ to simply copy the token returned from `save()` after settings the view manually in the browser. The JSON format is human-readable and should be quite easy to tweak once generated, as `save()` will return even the default settings for all properties. You can call `save()` in your application code, or e.g. through the -Chrome developer console +Chrome developer console: ```javascript // Copy to clipboard diff --git a/docs/md/view.md b/docs/md/view.md index ce09f85d9c..99f83f9802 100644 --- a/docs/md/view.md +++ b/docs/md/view.md @@ -320,8 +320,6 @@ view = table.view(filter=[["a", "<", 100]]) #### Example -Use the `filters` attribute on `` instead of `filter`. - ```javascript const elem = document.querySelector("perspective-viewer"); await elem.restore({ @@ -345,7 +343,7 @@ widget.restore( ## Expressions -The `expressions` attribute specifies _new_ columns in Perspective that are +The `expressions` property specifies _new_ columns in Perspective that are created using existing column values or arbitary scalar values defined within the expression. In ``, expressions are added using the "New Column" button in the side panel. From 6f1e06e698026827b90c0a288f0f2a1951785339 Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Tue, 12 Oct 2021 03:15:00 -0400 Subject: [PATCH 10/10] v1.0.0 --- CHANGELOG.md | 82 +- README.md | 8 +- cpp/perspective/package.json | 2 +- docs/package.json | 12 +- docs/siteConfig.js | 13 +- examples/blocks/package.json | 10 +- examples/git-history/package.json | 10 +- examples/promo/package.json | 14 +- examples/react/package.json | 12 +- examples/remote-express/package.json | 10 +- examples/remote-workspace/package.json | 14 +- examples/tornado-python/package.json | 14 +- .../tornado-streaming-python/package.json | 14 +- examples/webpack-cross-origin/package.json | 12 +- examples/webpack/package.json | 12 +- .../workspace-editing-python/package.json | 14 +- examples/workspace/package.json | 14 +- lerna.json | 2 +- packages/perspective-bench/package.json | 10 +- packages/perspective-cli/package.json | 10 +- packages/perspective-jupyterlab/package.json | 12 +- packages/perspective-test/package.json | 4 +- packages/perspective-viewer-d3fc/package.json | 8 +- .../perspective-viewer-datagrid/package.json | 8 +- .../perspective-webpack-plugin/package.json | 2 +- packages/perspective-workspace/package.json | 6 +- packages/perspective/package.json | 4 +- python/perspective/package.json | 2 +- .../perspective/perspective/core/_version.py | 2 +- rust/perspective-viewer/README.md | 1066 ++++++++--------- rust/perspective-viewer/package.json | 4 +- yarn.lock | 14 - 32 files changed, 734 insertions(+), 687 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5014f73e7..ee91c636ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,74 @@ # Changelog +## [v1.0.0](https://github.com/finos/perspective/tree/HEAD) + +[Full Changelog](https://github.com/finos/perspective/compare/v1.0.0-rc.2...HEAD) + +**Breaking changes:** + +- New `\` [\#1488](https://github.com/finos/perspective/pull/1488) ([texodus](https://github.com/texodus)) + +**Implemented enhancements:** + +- toggleConfig\(\) via attribute and part of save\(\) \(for perspective-viewer\) [\#879](https://github.com/finos/perspective/issues/879) +- Boolean datagrid columns [\#1553](https://github.com/finos/perspective/pull/1553) ([texodus](https://github.com/texodus)) +- Persistent column widths [\#1549](https://github.com/finos/perspective/pull/1549) ([texodus](https://github.com/texodus)) +- Return booleans from expression comparisons, allow for vectors to be defined in expressions [\#1548](https://github.com/finos/perspective/pull/1548) ([sc1f](https://github.com/sc1f)) +- Boolean column filter controls for `\` [\#1547](https://github.com/finos/perspective/pull/1547) ([texodus](https://github.com/texodus)) +- Fix M1 \(Apple Silicon\) build for `perspective-python` and improve developer docs [\#1525](https://github.com/finos/perspective/pull/1525) ([sc1f](https://github.com/sc1f)) + +**Fixed bugs:** + +- `save` on a `perspective-viewer` emits `plugin: null` if the attribute hasnt been set, instead of using the active plugin \(e.g. datagrid\) [\#1501](https://github.com/finos/perspective/issues/1501) +- Scrolling in the Olympics example grids expands the table continuosly [\#1302](https://github.com/finos/perspective/issues/1302) +- table.replace + unique aggregate incorrectly sets values to 0 in datagrid [\#1175](https://github.com/finos/perspective/issues/1175) +- Heatmap doesn't work when dates are used in columns [\#1132](https://github.com/finos/perspective/issues/1132) +- Inconsistent UI when transposing Pivots [\#1021](https://github.com/finos/perspective/issues/1021) +- Fix \#1566, remove deprecated flags from WASM debug build [\#1567](https://github.com/finos/perspective/pull/1567) ([sc1f](https://github.com/sc1f)) +- Fix \#1562, fix regressions in PerspectiveWidget [\#1565](https://github.com/finos/perspective/pull/1565) ([sc1f](https://github.com/sc1f)) +- Fix python wheel CI [\#1552](https://github.com/finos/perspective/pull/1552) ([texodus](https://github.com/texodus)) +- Long expressions block edit and delete buttons [\#1546](https://github.com/finos/perspective/issues/1546) +- Perspective Viewer does not type tag or filter for booleans [\#1544](https://github.com/finos/perspective/issues/1544) +- Incorrect type for Filters in Typescript perspective-viewer/index.d.ts [\#1517](https://github.com/finos/perspective/issues/1517) +- Perspective-viewer compilation error due to missing loader. [\#1497](https://github.com/finos/perspective/issues/1497) +- table.size\(\) incorrect after remove\(\) [\#1225](https://github.com/finos/perspective/issues/1225) +- `table.remove\(keys\)` from node seems to corrupt indexing? [\#998](https://github.com/finos/perspective/issues/998) +- Fix examples [\#1556](https://github.com/finos/perspective/pull/1556) ([texodus](https://github.com/texodus)) +- Fix expression column button toolbar styling [\#1555](https://github.com/finos/perspective/pull/1555) ([texodus](https://github.com/texodus)) +- Fix hidden sort aggregate as `unique` only when sorted on the same axis [\#1554](https://github.com/finos/perspective/pull/1554) ([texodus](https://github.com/texodus)) +- Fixes `bucket\(\)` computed function validation [\#1551](https://github.com/finos/perspective/pull/1551) ([texodus](https://github.com/texodus)) +- Fix 'weighted mean' aggregate support in \ [\#1543](https://github.com/finos/perspective/pull/1543) ([texodus](https://github.com/texodus)) +- Fix column section collapse with expressions [\#1542](https://github.com/finos/perspective/pull/1542) ([texodus](https://github.com/texodus)) +- Fix `is \(not\) null`, `date`, `datetime` filters [\#1541](https://github.com/finos/perspective/pull/1541) ([texodus](https://github.com/texodus)) +- Fix workspace filter events [\#1540](https://github.com/finos/perspective/pull/1540) ([texodus](https://github.com/texodus)) +- Fix `docs` site and NPM artifact for `\` update [\#1533](https://github.com/finos/perspective/pull/1533) ([texodus](https://github.com/texodus)) +- Fix drag/drop exclusive cases [\#1532](https://github.com/finos/perspective/pull/1532) ([texodus](https://github.com/texodus)) +- Re-add `getEditPort\(\)` and `restyleElement\(\)` methods [\#1531](https://github.com/finos/perspective/pull/1531) ([texodus](https://github.com/texodus)) +- Use TypeScript for `@finos/perspective-viewer` [\#1530](https://github.com/finos/perspective/pull/1530) ([texodus](https://github.com/texodus)) +- Fix `settings` key to trigger redraw + container redraw [\#1529](https://github.com/finos/perspective/pull/1529) ([texodus](https://github.com/texodus)) +- Fix \#1505, \#998, \#1225 - results after remove are correct [\#1528](https://github.com/finos/perspective/pull/1528) ([sc1f](https://github.com/sc1f)) +- Fix D3FC chart resize via `preserveAspectRatio` [\#1526](https://github.com/finos/perspective/pull/1526) ([texodus](https://github.com/texodus)) + +**Closed issues:** + +- Segfault with python 3.9 expressions [\#1572](https://github.com/finos/perspective/issues/1572) +- Loading remote table from Python breaks the viewer [\#1566](https://github.com/finos/perspective/issues/1566) +- PerspectiveWidget should init a shared\_worker and not a worker-per-widget [\#1562](https://github.com/finos/perspective/issues/1562) +- Perspective Viewer does not work in Custom Element Examples remote\_express and remote-express-typescript [\#1536](https://github.com/finos/perspective/issues/1536) +- Perspective refuses to work with React with webpack 4.x [\#1512](https://github.com/finos/perspective/issues/1512) +- `bucket\(\)` expression doesn't validate when 0 or more than 1 space separate arguments [\#1550](https://github.com/finos/perspective/issues/1550) +- Records added via table.update do not appear in perspective viewer filter values [\#1535](https://github.com/finos/perspective/issues/1535) +- Inconsistent view output under frequent insert&delete [\#1505](https://github.com/finos/perspective/issues/1505) + +**Merged pull requests:** + +- `docs` for updated `perspective-viewer` [\#1574](https://github.com/finos/perspective/pull/1574) ([texodus](https://github.com/texodus)) +- Make `/node\_modules` external to TS [\#1557](https://github.com/finos/perspective/pull/1557) ([texodus](https://github.com/texodus)) +- Upgrade emscripten to 2.0.29 [\#1539](https://github.com/finos/perspective/pull/1539) ([texodus](https://github.com/texodus)) +- Add docs for `\` [\#1538](https://github.com/finos/perspective/pull/1538) ([texodus](https://github.com/texodus)) +- Lint upgrade and remove TypeScript for `@finos/perspective-jupyterlab` [\#1537](https://github.com/finos/perspective/pull/1537) ([texodus](https://github.com/texodus)) +- add some light sdist tests and upload sdist in CI [\#1433](https://github.com/finos/perspective/pull/1433) ([timkpaine](https://github.com/timkpaine)) + ## [v0.10.3](https://github.com/finos/perspective/tree/HEAD) [Full Changelog](https://github.com/finos/perspective/compare/v0.10.2...HEAD) @@ -9,8 +78,6 @@ - Refactor `to\_arrow`, fix row deltas for pivoted views [\#1519](https://github.com/finos/perspective/pull/1519) ([sc1f](https://github.com/sc1f)) - Fix count aggregate when last aggregate and partial updates are applied [\#1518](https://github.com/finos/perspective/pull/1518) ([sc1f](https://github.com/sc1f)) -# Changelog - ## [v0.10.2](https://github.com/finos/perspective/tree/HEAD) [Full Changelog](https://github.com/finos/perspective/compare/v0.10.1...v0.10.2) @@ -21,8 +88,6 @@ - Fix support for array-like filter terms [\#1524](https://github.com/finos/perspective/pull/1524) ([texodus](https://github.com/texodus)) - Add new aggregates to ViewConfig enum [\#1516](https://github.com/finos/perspective/pull/1516) ([sc1f](https://github.com/sc1f)) -# Changelog - ## [v0.10.1](https://github.com/finos/perspective/tree/HEAD) [Full Changelog](https://github.com/finos/perspective/compare/v0.10.0...v0.10.1) @@ -50,8 +115,6 @@ - Preload fonts [\#1481](https://github.com/finos/perspective/pull/1481) ([texodus](https://github.com/texodus)) - Refactoring [\#1471](https://github.com/finos/perspective/pull/1471) ([texodus](https://github.com/texodus)) -# Changelog - ## [v0.10.0](https://github.com/finos/perspective/tree/HEAD) [Full Changelog](https://github.com/finos/perspective/compare/v0.9.0...v0.10.0) @@ -83,8 +146,6 @@ - Add Jupyterlab tests to CI [\#1460](https://github.com/finos/perspective/pull/1460) ([texodus](https://github.com/texodus)) - Build Windows wheel, limit wheel builds to scheduled and tagged builds [\#1453](https://github.com/finos/perspective/pull/1453) ([sc1f](https://github.com/sc1f)) -# Changelog - ## [v0.9.0](https://github.com/finos/perspective/tree/HEAD) [Full Changelog](https://github.com/finos/perspective/compare/v0.8.3...HEAD) @@ -130,8 +191,6 @@ - Expose `join` aggregate [\#1434](https://github.com/finos/perspective/pull/1434) ([texodus](https://github.com/texodus)) - organize azure pipelines file [\#1381](https://github.com/finos/perspective/pull/1381) ([timkpaine](https://github.com/timkpaine)) -# Changelog - ## [v0.8.3](https://github.com/finos/perspective/tree/HEAD) [Full Changelog](https://github.com/finos/perspective/compare/v0.8.2...HEAD) @@ -2317,4 +2376,7 @@ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* + + \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/README.md b/README.md index 056aa59041..f77ea07eae 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,12 @@ data or streaming updates via [Apache Arrow](https://arrow.apache.org/). |||| |:--|:--|:--| -|Movies|Superstore|Maps Airports| -|[![Movies](https://gist.githubusercontent.com/texodus/6b4dcebf65db4ebe4fe53a6de5ea0b48/raw/f56e588eed348aea579cf8fe757ce78c58779c82/thumbnail.png)](https://bl.ocks.org/texodus/6b4dcebf65db4ebe4fe53a6de5ea0b48)|[![Superstore](https://bl.ocks.org/texodus/raw/803de90736a3641ad91c5c7a1b49d0a7/thumbnail.png)](https://bl.ocks.org/texodus/803de90736a3641ad91c5c7a1b49d0a7)|[![Maps Elevation](https://perspective.finos.org/img/airports_thumbnail.png)](https://bl.ocks.org/DevAndyLee/86b33055dbce1ccc709cb3238227bec1)| +|Movies|Superstore|NFT| +|[![Movies](https://gist.githubusercontent.com/texodus/6b4dcebf65db4ebe4fe53a6de5ea0b48/raw/f56e588eed348aea579cf8fe757ce78c58779c82/thumbnail.png)](https://bl.ocks.org/texodus/6b4dcebf65db4ebe4fe53a6de5ea0b48)|[![Superstore](https://bl.ocks.org/texodus/raw/803de90736a3641ad91c5c7a1b49d0a7/thumbnail.png)](https://bl.ocks.org/texodus/803de90736a3641ad91c5c7a1b49d0a7)|[](https://sc1f.github.io/pudgy-penguin-perspective/)| |NYPD CCRB|Olympics|Custom Styles| |[](https://texodus.github.io/nypd-ccrb/)|[![Olympics](http://bl.ocks.org/texodus/raw/efd4a857aca9a52ab6cddbb6e1f701c9/c6c0fb7611ca742830e05cce667678c25b6f288a/thumbnail.png)](https://bl.ocks.org/texodus/efd4a857aca9a52ab6cddbb6e1f701c9)|[![Custom Styles](http://bl.ocks.org/texodus/raw/c42f3189699bd29cf20bbe7dce767b07/62d75a47e049602312ba2597bfd37eb032b156f0/thumbnail.png)](http://bl.ocks.org/texodus/c42f3189699bd29cf20bbe7dce767b07)| -|Editable|Maps Elevation|Streaming| -|[![Editable](https://bl.ocks.org/texodus/raw/45b868833c9f456bd39a51e606412c5d/e590d237a5237790694946018680719c9fef56cb/thumbnail.png)](https://bl.ocks.org/texodus/45b868833c9f456bd39a51e606412c5d)|[![Maps Elevation](https://perspective.finos.org/img/elevation_thumbnail.png)](https://bl.ocks.org/DevAndyLee/0efd87f7c0b8725a1c6bef8eafe86103)|[![Streaming](https://bl.ocks.org/texodus/raw/9bec2f8041471bafc2c56db2272a9381/c69c2cfacb23015f3aaeab3555a0035702ffdb1c/thumbnail.png)](https://bl.ocks.org/texodus/9bec2f8041471bafc2c56db2272a9381)| +|Editable|Maps Airports|Streaming| +|[![Editable](https://bl.ocks.org/texodus/raw/45b868833c9f456bd39a51e606412c5d/e590d237a5237790694946018680719c9fef56cb/thumbnail.png)](https://bl.ocks.org/texodus/45b868833c9f456bd39a51e606412c5d)|[![Maps Airpors](https://perspective.finos.org/img/airports_thumbnail.png)](https://bl.ocks.org/DevAndyLee/86b33055dbce1ccc709cb3238227bec1)|[![Streaming](https://bl.ocks.org/texodus/raw/9bec2f8041471bafc2c56db2272a9381/c69c2cfacb23015f3aaeab3555a0035702ffdb1c/thumbnail.png)](https://bl.ocks.org/texodus/9bec2f8041471bafc2c56db2272a9381)| |IEX Cloud|NYC Citibike|JupyterLab Plugin| |[![IEX Cloud](https://bl.ocks.org/texodus/raw/eb151fdd9f98bde987538cbc20e003f6/79d409006f50b24f1607758945144b392e4921a2/thumbnail.png)](https://bl.ocks.org/texodus/eb151fdd9f98bde987538cbc20e003f6)|[![NYC Citibike](https://bl.ocks.org/texodus/raw/bc8d7e6f72e09c9dbd7424b4332cacad/f704ce53a3f453f8fe66bd9ff4ead831786384ea/thumbnail.png)](https://bl.ocks.org/texodus/bc8d7e6f72e09c9dbd7424b4332cacad)|[![JupyterLab Plugin](https://perspective.finos.org/img/jupyterlab.png)](http://beta.mybinder.org/v2/gh/finos/perspective/master?urlpath=lab/tree/examples/jupyter-notebooks)| |CSV|Magic|Maps Citibike| diff --git a/cpp/perspective/package.json b/cpp/perspective/package.json index 5ccac19efa..e0cd6466dd 100644 --- a/cpp/perspective/package.json +++ b/cpp/perspective/package.json @@ -3,7 +3,7 @@ "private": true, "author": "The Perspective Authors", "license": "Apache-2.0", - "version": "1.0.0-rc.2", + "version": "1.0.0", "main": "./dist/esm/perspective.cpp.js", "files": [ "dist/esm/**/*", diff --git a/docs/package.json b/docs/package.json index 1b59c1dba0..fa8aaaaca0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@finos/docs", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "scripts": { "theme": "lessc static/css/material.dark.less > static/css/material.dark.css", "examples": "docusaurus-examples", @@ -16,11 +16,11 @@ }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.8.3", - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "@finos/perspective-workspace": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", + "@finos/perspective-workspace": "^1.0.0", "docusaurus": "^1.8.0", "less": "^3.9.0" }, diff --git a/docs/siteConfig.js b/docs/siteConfig.js index cf9a4c3ce9..d7573be61d 100644 --- a/docs/siteConfig.js +++ b/docs/siteConfig.js @@ -29,6 +29,12 @@ const siteConfig = { infoLink: "https://texodus.github.io/nypd-ccrb/", caption: "CCRB" }, + { + pinned: true, + image: "https://sc1f.github.io/pudgy-penguin-perspective/meta.png", + infoLink: "https://sc1f.github.io/pudgy-penguin-perspective/", + caption: "NFT" + }, { pinned: true, image: "https://perspective.finos.org/img/mtg_thumbnail.png", @@ -47,13 +53,6 @@ const siteConfig = { infoLink: "https://bl.ocks.org/texodus/efd4a857aca9a52ab6cddbb6e1f701c9", caption: "Olympics" }, - { - pinned: true, - image: "https://bl.ocks.org/texodus/raw/c42f3189699bd29cf20bbe7dce767b07/62d75a47e049602312ba2597bfd37eb032b156f0/thumbnail.png", - infoLink: "https://bl.ocks.org/texodus/c42f3189699bd29cf20bbe7dce767b07", - caption: "Styled" - }, - { pinned: true, image: "https://bl.ocks.org/texodus/raw/45b868833c9f456bd39a51e606412c5d/e590d237a5237790694946018680719c9fef56cb/thumbnail.png ", diff --git a/examples/blocks/package.json b/examples/blocks/package.json index 91508d2049..076f853ebf 100644 --- a/examples/blocks/package.json +++ b/examples/blocks/package.json @@ -1,7 +1,7 @@ { "name": "blocks", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "A collection of simple client-side Perspective examples for `http://bl.ocks.org`.", "scripts": { "start": "mkdirp dist && node server.js", @@ -11,10 +11,10 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", "superstore-arrow": "1.0.0" } } diff --git a/examples/git-history/package.json b/examples/git-history/package.json index 62f283cdab..b8df971a21 100644 --- a/examples/git-history/package.json +++ b/examples/git-history/package.json @@ -1,7 +1,7 @@ { "name": "git-history", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example of Perspective's own GIT history rendered in Perspective.", "scripts": { "start": "node server.js" @@ -9,9 +9,9 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0" } } diff --git a/examples/promo/package.json b/examples/promo/package.json index 9e5be860ff..919b7fe629 100644 --- a/examples/promo/package.json +++ b/examples/promo/package.json @@ -1,7 +1,7 @@ { "name": "promo", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An puppeteer-guided demo of Perspective's functionality, as seen on Github.", "scripts": { "dev": "webpack-dev-server --open", @@ -13,14 +13,14 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "@finos/perspective-workspace": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", + "@finos/perspective-workspace": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "http-server": "^0.11.1", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" diff --git a/examples/react/package.json b/examples/react/package.json index fe61dbfe87..8b3df2b713 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -1,7 +1,7 @@ { "name": "react", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example app built using `@finos/perspective-viewer`.", "scripts": { "start": "webpack serve --open", @@ -10,15 +10,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", "react": "16.8.6", "react-dom": "16.8.6" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "@types/react": "^16.8.6", "@types/react-dom": "^16.9.4", "source-map-loader": "^0.2.4", diff --git a/examples/remote-express/package.json b/examples/remote-express/package.json index b1b4738620..7ce44d574d 100644 --- a/examples/remote-express/package.json +++ b/examples/remote-express/package.json @@ -1,7 +1,7 @@ { "name": "remote-express", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example of 2 Perspectives, one client and one server, streaming via Apache Arrow.", "scripts": { "start": "tsc && node dist/server.js" @@ -9,10 +9,10 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0" }, "devDependencies": { "@types/express": "^4.17.3", diff --git a/examples/remote-workspace/package.json b/examples/remote-workspace/package.json index ab4b52be4d..df9ed515b0 100644 --- a/examples/remote-workspace/package.json +++ b/examples/remote-workspace/package.json @@ -1,7 +1,7 @@ { "name": "remote-workspace", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example app built using `@finos/perspective-workspace`.", "scripts": { "start:server": "webpack serve --open", @@ -11,14 +11,14 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "@finos/perspective-workspace": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", + "@finos/perspective-workspace": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "http-server": "^0.11.1", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" diff --git a/examples/tornado-python/package.json b/examples/tornado-python/package.json index 39d217818b..701c02ad2b 100644 --- a/examples/tornado-python/package.json +++ b/examples/tornado-python/package.json @@ -1,7 +1,7 @@ { "name": "tornado-python", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example of editing a `perspective-python` server from the browser.", "scripts": { "start": "PYTHONPATH=../../python/perspective python3 server.py", @@ -10,15 +10,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "@finos/perspective-workspace": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", + "@finos/perspective-workspace": "^1.0.0", "superstore-arrow": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" } diff --git a/examples/tornado-streaming-python/package.json b/examples/tornado-streaming-python/package.json index 38ccd5d476..39aa4c2f56 100644 --- a/examples/tornado-streaming-python/package.json +++ b/examples/tornado-streaming-python/package.json @@ -1,7 +1,7 @@ { "name": "tornado-streaming-python", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example of streaming a `perspective-python` server to the browser.", "scripts": { "start": "PYTHONPATH=../../python/perspective python3 server.py", @@ -10,15 +10,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "@finos/perspective-workspace": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", + "@finos/perspective-workspace": "^1.0.0", "superstore-arrow": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" } diff --git a/examples/webpack-cross-origin/package.json b/examples/webpack-cross-origin/package.json index 17ee8da82c..fc6cef543b 100644 --- a/examples/webpack-cross-origin/package.json +++ b/examples/webpack-cross-origin/package.json @@ -1,7 +1,7 @@ { "name": "webpack-cross-origin", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example of using the Perspective Webpack plugin to build a JS file with Webpack.", "scripts": { "start": "npm-run-all -l -p webpack-watch host:app host:bundles", @@ -12,13 +12,13 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "http-server": "^0.11.1" } } diff --git a/examples/webpack/package.json b/examples/webpack/package.json index a53bd77835..07087c8aa5 100644 --- a/examples/webpack/package.json +++ b/examples/webpack/package.json @@ -1,7 +1,7 @@ { "name": "webpack", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example app built using `@finos/perspective-viewer`.", "scripts": { "start": "webpack serve" @@ -9,13 +9,13 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "css-loader": "^0.28.7", "file-loader": "^4.2.0", "style-loader": "^0.18.2", diff --git a/examples/workspace-editing-python/package.json b/examples/workspace-editing-python/package.json index 9f0ae9e03c..20fe559524 100644 --- a/examples/workspace-editing-python/package.json +++ b/examples/workspace-editing-python/package.json @@ -1,7 +1,7 @@ { "name": "workspace-editing-python", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example app demonstrating client/server editing, built using `@finos/perspective-workspace` and `perspective-python`.", "scripts": { "start": "yarn webpack && yarn start:server", @@ -12,14 +12,14 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "@finos/perspective-workspace": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", + "@finos/perspective-workspace": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "http-server": "^0.11.1", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" diff --git a/examples/workspace/package.json b/examples/workspace/package.json index d6f319c774..892d986c02 100644 --- a/examples/workspace/package.json +++ b/examples/workspace/package.json @@ -1,7 +1,7 @@ { "name": "workspace", "private": true, - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "An example app built using `@finos/perspective-workspace`.", "scripts": { "start": "webpack serve --open", @@ -10,14 +10,14 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", - "@finos/perspective-workspace": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", + "@finos/perspective-workspace": "^1.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^1.0.0-rc.2", + "@finos/perspective-webpack-plugin": "^1.0.0", "http-server": "^0.11.1", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" diff --git a/lerna.json b/lerna.json index ca8895acc2..dea23f5286 100644 --- a/lerna.json +++ b/lerna.json @@ -6,5 +6,5 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.0.0-rc.2" + "version": "1.0.0" } diff --git a/packages/perspective-bench/package.json b/packages/perspective-bench/package.json index 254e5dd204..8a900e067c 100644 --- a/packages/perspective-bench/package.json +++ b/packages/perspective-bench/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-bench", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Benchmark utility based on perspective", "private": true, "main": "src/js/bench.js", @@ -29,9 +29,9 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.8.4", - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2" + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0" } } diff --git a/packages/perspective-cli/package.json b/packages/perspective-cli/package.json index 89ba2e8536..12d42b6991 100644 --- a/packages/perspective-cli/package.json +++ b/packages/perspective-cli/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-cli", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Perspective.js CLI", "main": "build/index.js", "publishConfig": { @@ -27,10 +27,10 @@ "perspective": "perspective" }, "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", "commander": "^2.19.0", "core-js": "^3.6.4" } diff --git a/packages/perspective-jupyterlab/package.json b/packages/perspective-jupyterlab/package.json index 66479d58ec..50403ff0b7 100644 --- a/packages/perspective-jupyterlab/package.json +++ b/packages/perspective-jupyterlab/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-jupyterlab", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "A Jupyterlab extension for the Perspective library, designed to be used with perspective-python.", "files": [ "dist/*.d.ts", @@ -35,17 +35,17 @@ "version": "yarn build" }, "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", - "@finos/perspective-viewer-d3fc": "^1.0.0-rc.2", - "@finos/perspective-viewer-datagrid": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", + "@finos/perspective-viewer-d3fc": "^1.0.0", + "@finos/perspective-viewer-datagrid": "^1.0.0", "@jupyter-widgets/base": "^3.0.0 || ^4.0.0", "@jupyterlab/application": "^3.0.0", "@lumino/application": "^1.7.3", "@lumino/widgets": "^1.9.3" }, "devDependencies": { - "@finos/perspective-test": "^1.0.0-rc.2", + "@finos/perspective-test": "^1.0.0", "@jupyter-widgets/base-manager": "^1.0.0-alpha.0", "identity-obj-proxy": "^3.0.0", "isomorphic-fetch": "^2.2.1", diff --git a/packages/perspective-test/package.json b/packages/perspective-test/package.json index 16eb66c675..d0dc45412e 100644 --- a/packages/perspective-test/package.json +++ b/packages/perspective-test/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-test", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Test utility based on perspective", "private": true, "main": "src/js/index.js", @@ -21,7 +21,7 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", "core-js": "^3.6.4", "xml-formatter": "2.4.0" } diff --git a/packages/perspective-viewer-d3fc/package.json b/packages/perspective-viewer-d3fc/package.json index f9ff5f9060..ebc8aac58b 100644 --- a/packages/perspective-viewer-d3fc/package.json +++ b/packages/perspective-viewer-d3fc/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-viewer-d3fc", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Perspective.js D3FC Plugin", "main": "./dist/cjs/perspective-viewer-d3fc.js", "module": "./dist/cjs/perspective-viewer-d3fc.js", @@ -49,8 +49,8 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", "babel-runtime": "^6.26.0", "chroma-js": "^1.3.4", "core-js": "^3.6.4", @@ -60,6 +60,6 @@ "gradient-parser": "0.1.5" }, "devDependencies": { - "@finos/perspective-test": "^1.0.0-rc.2" + "@finos/perspective-test": "^1.0.0" } } diff --git a/packages/perspective-viewer-datagrid/package.json b/packages/perspective-viewer-datagrid/package.json index 7c2dfb6cc4..03401d173b 100644 --- a/packages/perspective-viewer-datagrid/package.json +++ b/packages/perspective-viewer-datagrid/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-viewer-datagrid", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Perspective.js", "main": "dist/esm/perspective-viewer-datagrid.js", "module": "dist/esm/perspective-viewer-datagrid.js", @@ -38,12 +38,12 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", - "@finos/perspective-viewer": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", + "@finos/perspective-viewer": "^1.0.0", "chroma-js": "^1.3.4", "regular-table": "=0.4.1" }, "devDependencies": { - "@finos/perspective-test": "^1.0.0-rc.2" + "@finos/perspective-test": "^1.0.0" } } diff --git a/packages/perspective-webpack-plugin/package.json b/packages/perspective-webpack-plugin/package.json index 0035f57488..affadd1357 100644 --- a/packages/perspective-webpack-plugin/package.json +++ b/packages/perspective-webpack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-webpack-plugin", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Perspective.js Webpack Plugin", "main": "index.js", "publishConfig": { diff --git a/packages/perspective-workspace/package.json b/packages/perspective-workspace/package.json index 865ae9712c..ff847ed7c3 100644 --- a/packages/perspective-workspace/package.json +++ b/packages/perspective-workspace/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-workspace", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Perspective Workspace", "main": "./dist/cjs/perspective-workspace.js", "module": "./dist/cjs/perspective-workspace.js", @@ -38,7 +38,7 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@finos/perspective-viewer": "^1.0.0-rc.2", + "@finos/perspective-viewer": "^1.0.0", "@lumino/algorithm": "^1.2.0", "@lumino/commands": "^1.7.2", "@lumino/domutils": "^1.1.4", @@ -49,7 +49,7 @@ "lodash": "^4.17.4" }, "devDependencies": { - "@finos/perspective-test": "^1.0.0-rc.2", + "@finos/perspective-test": "^1.0.0", "babel-loader": "^8.0.6", "babel-runtime": "^6.26.0", "lodash.clonedeep": "^4.5.0" diff --git a/packages/perspective/package.json b/packages/perspective/package.json index 1ac6ad0bb3..dfe8e4b611 100644 --- a/packages/perspective/package.json +++ b/packages/perspective/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "Perspective.js", "main": "dist/cjs/perspective.node.js", "unpkg": "dist/umd/perspective.js", @@ -64,7 +64,7 @@ "ws": "^6.1.2" }, "devDependencies": { - "@finos/perspective-cpp": "^1.0.0-rc.2", + "@finos/perspective-cpp": "^1.0.0", "jsverify": "^0.8.4", "moment": "^2.19.1", "papaparse": "^5.2.0" diff --git a/python/perspective/package.json b/python/perspective/package.json index 96f72c31f3..bd3ecf61b1 100644 --- a/python/perspective/package.json +++ b/python/perspective/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "perspective-python-internal", - "version": "1.0.0-rc.2", + "version": "1.0.0", "scripts": { "bench": "python3 bench/perspective_benchmark.py", "docs": "python3 docs/generate.py" diff --git a/python/perspective/perspective/core/_version.py b/python/perspective/perspective/core/_version.py index 35edb81191..90ad1fb716 100644 --- a/python/perspective/perspective/core/_version.py +++ b/python/perspective/perspective/core/_version.py @@ -1,2 +1,2 @@ -__version__ = "1.0.0-rc.2" +__version__ = "1.0.0" major_minor_version = "1.0" diff --git a/rust/perspective-viewer/README.md b/rust/perspective-viewer/README.md index a3acb6b110..1680551c1e 100644 --- a/rust/perspective-viewer/README.md +++ b/rust/perspective-viewer/README.md @@ -39,158 +39,167 @@ relevent DOM method e.g. `document.createElement("perspective-viewer")` or #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:16](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L16) +[rust/perspective-viewer/src/ts/viewer.ts:16](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L16) -# Class: PerspectiveViewerElement +# Interface: IPerspectiveViewerPlugin -The Custom Elements implementation for ``, as well at its -API. `PerspectiveViewerElement` should not be constructed directly (like its -parent class `HTMLElement`); instead, use `document.createElement()` or -declare your `` element in HTML. Once instantiated, -`` works just like a standard `HTMLElement`, with a few -extra perspective-specific methods. +The `IPerspectiveViewerPlugin` interface defines the necessary API for a +`` plugin, which also must be an `HTMLElement` via the +Custom Elements API or otherwise. Rather than implement this API from +scratch however, the simplest way is to inherit from +``, which implements `IPerspectiveViewerPlugin` +with non-offensive default implementations, where only the `draw()` and +`name()` methods need be overridden to get started with a simple plugin. -**`example`** -```javascript -const viewer = document.createElement("perspective-viewer"); -``` +Note that plugins are frozen once a `` has been +instantiated, so generally new plugin code must be executed at the module +level (if packaged as a library), or during application init to ensure global +availability of a plugin. **`example`** ```javascript -document.body.innerHTML = ` - -`; -const viewer = document.body.querySelector("#viewer"); +const BasePlugin = customElements.get("perspective-viewer-plugin"); +class MyPlugin extends BasePlugin { + get name() { + return "My Plugin"; + } + async draw(view) { + const count = await view.num_rows(); + this.innerHTML = `View has ${count} rows`; + } +} + +customElements.define("my-plugin", MyPlugin); +const Viewer = customElements.get("perspective-viewer"); +Viewer.registerPlugin("my-plugin"); ``` ## Hierarchy - `HTMLElement` - ↳ **`PerspectiveViewerElement`** + ↳ **`IPerspectiveViewerPlugin`** + +## Implemented by + +- [`PerspectiveViewerPluginElement`](#`PerspectiveViewerPluginElement`) ## Table of contents -### Data Methods +### Accessors -- [getTable](#gettable) -- [load](#load) +- [config\_column\_names](#config_column_names) +- [min\_config\_columns](#min_config_columns) +- [name](#name) +- [select\_mode](#select_mode) -### Persistence Methods +### Methods -- [reset](#reset) +- [clear](#clear) +- [delete](#delete) +- [draw](#draw) +- [resize](#resize) - [restore](#restore) +- [restyle](#restyle) - [save](#save) +- [update](#update) -### Plugin Methods +## Accessors -- [getAllPlugins](#getallplugins) -- [getPlugin](#getplugin) -- [registerPlugin](#registerplugin) +### config\_column\_names -### UI Action Methods +• `get` **config_column_names**(): `string`[] -- [copy](#copy) -- [download](#download) -- [toggleConfig](#toggleconfig) +The named column labels, if desired. Named columns behave differently +in drag/drop mode than unnamed columns, having replace/swap behavior +rather than insert. If provided, the length of `config_column_names` +_must_ be `>= min_config_columns`, as this is assumed by the drag/drop +logic. -### Util Methods +#### Returns -- [delete](#delete) -- [flush](#flush) -- [getEditPort](#geteditport) -- [notifyResize](#notifyresize) -- [restyleElement](#restyleelement) -- [setThrottle](#setthrottle) +`string`[] -## Data Methods +#### Defined in -### getTable +[rust/perspective-viewer/src/ts/plugin.ts:80](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L80) -▸ **getTable**(): `Promise`<`Table`\> +___ -Returns the `perspective.Table()` which was supplied to `load()`. If -`load()` has been called but the supplied `Promise` -has not resolved, `getTable()` will `await`; if `load()` has not yet -been called, an `Error` will be thrown. +### min\_config\_columns -**`example`** -```javascript -const viewers = document.querySelectorAll("perspective-viewer"); -const [viewer1, viewer2] = Array.from(viewers); -const table = await viewer1.getTable(); -await viewer2.load(table); -``` +• `get` **min_config_columns**(): `number` -#### Returns +The minimum number of columns required for this plugin to operate. +This mostly affects drag/drop and column remove button behavior, +preventing the use from applying configs which violate this min. -`Promise`<`Table`\> +While this option can technically be `undefined` (as in the case of +`@finos/perspective-viewer-datagrid`), doing so currently has nearly +identical behavior to 1. -A `Promise` which resolves to a `perspective.Table` +#### Returns + +`number` #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:158](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L158) +[rust/perspective-viewer/src/ts/plugin.ts:71](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L71) ___ -### load +### name -▸ **load**(`table`): `Promise`<`void`\> +• `get` **name**(): `string` -Load a `perspective.Table`. If `load` or `update` have already been -called on this element, its internal `perspective.Table` will _not_ be -deleted, but it will bed de-referenced by this ``. +The name for this plugin, which is used as both it's unique key for use +as a parameter for the `plugin` field of a `ViewerConfig`, and as the +display name for this plugin in the `` UI. -**`example`** -```javascript -const my_viewer = document.getElementById('#my_viewer'); -const tbl = perspective.table("x,y\n1,a\n2,b"); -my_viewer.load(tbl); -``` +#### Returns -**`example`** -```javascript -const my_viewer = document.getElementById('#my_viewer'); -const tbl = perspective.table("x,y\n1,a\n2,b"); -my_viewer.load(tbl); -``` +`string` -#### Parameters +#### Defined in -| Name | Type | -| :------ | :------ | -| `table` | `Table` \| `Promise`<`Table`\> | +[rust/perspective-viewer/src/ts/plugin.ts:52](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L52) -#### Returns +___ -`Promise`<`void`\> +### select\_mode -A promise which resolves once the data is -loaded, a `perspective.View` has been created, and the active plugin has -rendered. +• `get` **select_mode**(): ``"select"`` \| ``"toggle"`` -#### Defined in +Select mode determines how column add/remove buttons behave for this +plugin. `"select"` mode exclusively selects the added column, removing +other columns. `"toggle"` mode toggles the column on or off (dependent +on column state), leaving existing columns alone. -[rust/perspective-viewer/src/ts/viewer.ts:115](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L115) +#### Returns -___ +``"select"`` \| ``"toggle"`` -## Persistence Methods +#### Defined in -### reset +[rust/perspective-viewer/src/ts/plugin.ts:60](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L60) -▸ **reset**(): `Promise`<`void`\> +## Methods -Reset's this element's view state and attributes to default. Does not -delete this element's `perspective.table` or otherwise modify the data -state. +### clear + +▸ **clear**(): `Promise`<`void`\> + +Clear this plugin, though it is up to the discretion of the plugin +author to determine what this means. Defaults to resetting this +element's `innerHTML`, so be sure to override if you want custom +behavior. **`example`** ```javascript -const viewer = document.querySelector("perspective-viewer"); -await viewer.reset(); +async clear(): Promise { + this.innerHTML = ""; +} ``` #### Returns @@ -199,216 +208,158 @@ await viewer.reset(); #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:276](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L276) +[rust/perspective-viewer/src/ts/plugin.ts:124](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L124) ___ -### restore - -▸ **restore**(`config`): `Promise`<`void`\> - -Restore this element to a state as generated by a reciprocal call to -`save`. In `json` (default) format, `PerspectiveViewerConfig`'s fields -have specific semantics: - - - When a key is missing, this field is ignored; `` - will maintain whatever settings for this field is currently applied. - - When the key is supplied, but the value is `undefined`, the field is - reset to its default value for this current `View`, i.e. the state it - would be in after `load()` resolves. - - When the key is defined to a value, the value is applied for this - field. - -This behavior is convenient for explicitly controlling current vs desired -UI state in a single request, but it does make it a bit inconvenient to -use `restore()` to reset a `` to default as you must -do so explicitly for each key; for this case, use `reset()` instead of -restore. - -As noted in `save()`, this configuration state does not include the -`Table` or its `Schema`. In order for `restore()` to work correctly, it -must be called on a `` that has a `Table already -`load()`-ed, with the same (or a type-compatible superset) `Schema`. -It does not need have the same rows, or even be populated. - -**`example`** -```javascript -const viewer = document.querySelector("perspective-viewer"); -const token = localStorage.getItem("viewer_state"); -await viewer.restore(token); -``` +### delete -#### Parameters +▸ **delete**(): `Promise`<`void`\> -| Name | Type | Description | -| :------ | :------ | :------ | -| `config` | `string` \| [`PerspectiveViewerConfig`](#perspectiveviewerconfig) \| `ArrayBuffer` | returned by `save()`. This can be any format returned by `save()`; the specific deserialization is chosen by `typeof config`. | +Free any resources acquired by this plugin and prepare to be deleted. #### Returns `Promise`<`void`\> -A promise which resolves when the changes have been applied and -rendered. - #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:201](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L201) +[rust/perspective-viewer/src/ts/plugin.ts:159](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L159) ___ -### save +### draw -▸ **save**(): `Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> +▸ **draw**(`view`): `Promise`<`void`\> -Serialize this element's attribute/interaction state, but _not_ the -`perspective.Table` or its `Schema`. `save()` is designed to be used in -conjunction with `restore()` to persist user settings and bookmarks, but -the `PerspectiveViewerConfig` object returned in `json` format can also -be written by hand quite easily, which is useful for authoring -pre-conceived configs. +Render this plugin using the provided `View`. While there is no +provision to cancel a render in progress per se, calling a method on +a `View` which has been deleted will throw an exception. -**`example`** -```javascript -const viewer = document.querySelector("perspective-viewer"); -const token = await viewer.save("string"); -localStorage.setItem("viewer_state", token); +**`example`** +``` +async draw(view: perspective.View): Promise { + const csv = await view.to_csv(); + this.innerHTML = `
${csv}
`; +} ``` - -#### Returns - -`Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> - -a serialized element in the chosen format. - -#### Defined in - -[rust/perspective-viewer/src/ts/viewer.ts:228](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L228) - -▸ **save**(`format`): `Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> #### Parameters | Name | Type | | :------ | :------ | -| `format` | ``"json"`` | +| `view` | `View` | #### Returns -`Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:229](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L229) +[rust/perspective-viewer/src/ts/plugin.ts:95](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L95) -▸ **save**(`format`): `Promise`<`ArrayBuffer`\> +___ -#### Parameters +### resize -| Name | Type | -| :------ | :------ | -| `format` | ``"arraybuffer"`` | +▸ **resize**(): `Promise`<`void`\> + +Like `update()`, but for when the dimensions of the plugin have changed +and the underlying data has not. #### Returns -`Promise`<`ArrayBuffer`\> +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:230](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L230) +[rust/perspective-viewer/src/ts/plugin.ts:130](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L130) -▸ **save**(`format`): `Promise`<`string`\> +___ + +### restore + +▸ **restore**(`config`): `Promise`<`void`\> + +Restore this plugin to a state previously returned by `save()`. #### Parameters | Name | Type | | :------ | :------ | -| `format` | ``"string"`` | +| `config` | `any` | #### Returns -`Promise`<`string`\> +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:231](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L231) +[rust/perspective-viewer/src/ts/plugin.ts:154](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L154) ___ -## Plugin Methods - -### getAllPlugins - -▸ **getAllPlugins**(): `Promise`<`HTMLElement`[]\> +### restyle -Get all plugin custom element instances, in order of registration. +▸ **restyle**(): `Promise`<`void`\> -If no plugins have been registered (via `registerPlugin()`), calling -`getAllPlugins()` will cause `perspective-viewer-plugin` to be registered -as a side effect. +Notify the plugin that the style environment has changed. Useful for +plugins which read CSS styles via `window.getComputedStyle()`. #### Returns -`Promise`<`HTMLElement`[]\> - -An `Array` of the plugin instances for this -``. +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:448](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L448) +[rust/perspective-viewer/src/ts/plugin.ts:136](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L136) ___ -### getPlugin - -▸ **getPlugin**(`name?`): `Promise`<`HTMLElement`\> - -Get the currently active plugin custom element instance, or a specific -named instance if requested. `getPlugin(name)` does not activate the -plugin requested, so if this plugin is not active the returned -`HTMLElement` will not have a `parentElement`. +### save -If no plugins have been registered (via `registerPlugin()`), calling -`getPlugin()` will cause `perspective-viewer-plugin` to be registered as -a side effect. +▸ **save**(): `Promise`<`any`\> -#### Parameters +Save this plugin's state to a JSON-serializable value. While this value +can be anything, it should work reciprocally with `restore()` to return +this plugin's renderer to the same state, though potentially with a +different `View`. -| Name | Type | Description | -| :------ | :------ | :------ | -| `name?` | `string` | Optionally a specific plugin name, defaulting to the current active plugin. | +`save()` should be used for user-persistent settings that are +data-agnostic, so the user can have persistent view during refresh or +reload. For example, `@finos/perspective-viewer-d3fc` uses +`plugin_config` to remember the user-repositionable legend coordinates. #### Returns -`Promise`<`HTMLElement`\> - -The active or requested plugin instance. +`Promise`<`any`\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:431](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L431) +[rust/perspective-viewer/src/ts/plugin.ts:149](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L149) ___ -### registerPlugin +### update -▸ `Static` **registerPlugin**(`name`): `Promise`<`void`\> +▸ **update**(`view`): `Promise`<`void`\> -Register a new plugin via its custom element name. This method is called -automatically as a side effect of importing a plugin module, so this -method should only typically be called by plugin authors. +Draw under the assumption that the `ViewConfig` has not changed since +the previous call to `draw()`, but the underlying data has. Defaults to +dispatch to `draw()`. **`example`** ```javascript -customElements.get("perspective-viewer").registerPlugin("my-plugin"); +async update(view: perspective.View): Promise { + return this.draw(view); +} ``` #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `name` | `string` | The `name` of the custom element to register, as supplied to the `customElements.define(name)` method. | +| Name | Type | +| :------ | :------ | +| `view` | `View` | #### Returns @@ -416,114 +367,159 @@ customElements.get("perspective-viewer").registerPlugin("my-plugin"); #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:87](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L87) - -___ +[rust/perspective-viewer/src/ts/plugin.ts:109](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/plugin.ts#L109) -## UI Action Methods -### copy +# Class: PerspectiveViewerElement -▸ **copy**(`flat`): `Promise`<`void`\> +The Custom Elements implementation for ``, as well at its +API. `PerspectiveViewerElement` should not be constructed directly (like its +parent class `HTMLElement`); instead, use `document.createElement()` or +declare your `` element in HTML. Once instantiated, +`` works just like a standard `HTMLElement`, with a few +extra perspective-specific methods. -Copies this element's view data (as a CSV) to the clipboard. This method -must be called from an event handler, subject to the browser's -restrictions on clipboard access. See -[https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard](https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard). +**`example`** +```javascript +const viewer = document.createElement("perspective-viewer"); +``` **`example`** ```javascript -const viewer = document.querySelector("perspective-viewer"); -const button = document.querySelector("button"); -button.addEventListener("click", async () => { - await viewer.copy(); -}); +document.body.innerHTML = ` + +`; +const viewer = document.body.querySelector("#viewer"); ``` -#### Parameters +## Hierarchy -| Name | Type | Description | -| :------ | :------ | :------ | -| `flat` | `boolean` | Whether to use the element's current view config, or to use a default "flat" view. | +- `HTMLElement` -#### Returns + ↳ **`PerspectiveViewerElement`** -`Promise`<`void`\> +## Table of contents -#### Defined in +### Data Methods -[rust/perspective-viewer/src/ts/viewer.ts:325](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L325) +- [getTable](#gettable) +- [load](#load) -___ +### Persistence Methods -### download +- [reset](#reset) +- [restore](#restore) +- [save](#save) -▸ **download**(`flat`): `Promise`<`void`\> +### Plugin Methods -Download this element's data as a CSV file. +- [getAllPlugins](#getallplugins) +- [getPlugin](#getplugin) +- [registerPlugin](#registerplugin) -#### Parameters +### UI Action Methods -| Name | Type | Description | -| :------ | :------ | :------ | -| `flat` | `boolean` | Whether to use the element's current view config, or to use a default "flat" view. | +- [copy](#copy) +- [download](#download) +- [toggleConfig](#toggleconfig) + +### Util Methods + +- [delete](#delete) +- [flush](#flush) +- [getEditPort](#geteditport) +- [notifyResize](#notifyresize) +- [restyleElement](#restyleelement) +- [setThrottle](#setthrottle) + +## Data Methods + +### getTable + +▸ **getTable**(): `Promise`<`Table`\> + +Returns the `perspective.Table()` which was supplied to `load()`. If +`load()` has been called but the supplied `Promise` +has not resolved, `getTable()` will `await`; if `load()` has not yet +been called, an `Error` will be thrown. + +**`example`**
+```javascript +const viewers = document.querySelectorAll("perspective-viewer"); +const [viewer1, viewer2] = Array.from(viewers); +const table = await viewer1.getTable(); +await viewer2.load(table); +``` #### Returns -`Promise`<`void`\> +`Promise`<`Table`\> + +A `Promise` which resolves to a `perspective.Table` #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:302](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L302) +[rust/perspective-viewer/src/ts/viewer.ts:160](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L160) ___ -### toggleConfig +### load -▸ **toggleConfig**(`force?`): `Promise`<`void`\> +▸ **load**(`table`): `Promise`<`void`\> -Opens/closes the element's config menu, equivalent to clicking the -settings button in the UI. This method is equivalent to -`viewer.restore({settings: force})` when `force` is present, but -`restore()` cannot toggle as `toggleConfig()` can, you would need to -first read the settings state from `save()` otherwise. +Load a `perspective.Table`. If `load` or `update` have already been +called on this element, its internal `perspective.Table` will _not_ be +deleted, but it will bed de-referenced by this ``. -Calling `toggleConfig()` may be delayed if an async render is currently -in process, and it may only partially render the UI if `load()` has not -yet resolved. +**`example`** +```javascript +const my_viewer = document.getElementById('#my_viewer'); +const tbl = perspective.table("x,y\n1,a\n2,b"); +my_viewer.load(tbl); +``` -**`example`** +**`example`** ```javascript -await viewer.toggleConfig(); +const my_viewer = document.getElementById('#my_viewer'); +const tbl = perspective.table("x,y\n1,a\n2,b"); +my_viewer.load(tbl); ``` #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `force?` | `boolean` | If supplied, explicitly set the config state to "open" (`true`) or "closed" (`false`). | +| Name | Type | +| :------ | :------ | +| `table` | `Table` \| `Promise`<`Table`\> | #### Returns `Promise`<`void`\> +A promise which resolves once the data is +loaded, a `perspective.View` has been created, and the active plugin has +rendered. + #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:411](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L411) +[rust/perspective-viewer/src/ts/viewer.ts:115](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L115) ___ -## Util Methods +## Persistence Methods -### delete +### reset -▸ **delete**(): `Promise`<`void`\> +▸ **reset**(): `Promise`<`void`\> -Deletes this element and clears it's internal state (but not its -user state). This (or the underlying `perspective.view`'s equivalent -method) must be called in order for its memory to be reclaimed, as well -as the reciprocal method on the `perspective.table` which this viewer is -bound to. +Reset's this element's view state and attributes to default. Does not +delete this element's `perspective.table` or otherwise modify the data +state. + +**`example`** +```javascript +const viewer = document.querySelector("perspective-viewer"); +await viewer.reset(); +``` #### Returns @@ -531,331 +527,331 @@ bound to. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:290](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L290) +[rust/perspective-viewer/src/ts/viewer.ts:278](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L278) ___ -### flush +### restore -▸ **flush**(): `Promise`<`void`\> +▸ **restore**(`config`): `Promise`<`void`\> -Flush any pending modifications to this ``. Since -``'s API is almost entirely `async`, it may take -some milliseconds before any method call such as `restore()` affects -the rendered element. If you want to make sure any invoked method which -affects the rendered has had its results rendered, call and await -`flush()` +Restore this element to a state as generated by a reciprocal call to +`save`. In `json` (default) format, `PerspectiveViewerConfig`'s fields +have specific semantics: -**`example`** + - When a key is missing, this field is ignored; `` + will maintain whatever settings for this field is currently applied. + - When the key is supplied, but the value is `undefined`, the field is + reset to its default value for this current `View`, i.e. the state it + would be in after `load()` resolves. + - When the key is defined to a value, the value is applied for this + field. + +This behavior is convenient for explicitly controlling current vs desired +UI state in a single request, but it does make it a bit inconvenient to +use `restore()` to reset a `` to default as you must +do so explicitly for each key; for this case, use `reset()` instead of +restore. + +As noted in `save()`, this configuration state does not include the +`Table` or its `Schema`. In order for `restore()` to work correctly, it +must be called on a `` that has a `Table already +`load()`-ed, with the same (or a type-compatible superset) `Schema`. +It does not need have the same rows, or even be populated. + +**`example`** ```javascript const viewer = document.querySelector("perspective-viewer"); -viewer.restore({row_pivots: ["State"]}); -await viewer.flush(); -console.log("Viewer has been rendered with a pivot!"); +const token = localStorage.getItem("viewer_state"); +await viewer.restore(token); ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `config` | `string` \| [`PerspectiveViewerConfig`](#perspectiveviewerconfig) \| `ArrayBuffer` | returned by `save()`. This can be any format returned by `save()`; the specific deserialization is chosen by `typeof config`. | + #### Returns `Promise`<`void`\> -A promise which resolves when the current -pending state changes have been applied and rendered. +A promise which resolves when the changes have been applied and +rendered. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:259](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L259) +[rust/perspective-viewer/src/ts/viewer.ts:203](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L203) ___ -### getEditPort +### save -▸ **getEditPort**(): `Promise`<`number`\> +▸ **save**(): `Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> -Gets the edit port, the port number for which `Table` updates from this -`` are generated. This port number will be present -in the options object for a `View.on_update()` callback for any update -which was originated by the ``/user, which can be -used to distinguish server-originated updates from user edits. +Serialize this element's attribute/interaction state, but _not_ the +`perspective.Table` or its `Schema`. `save()` is designed to be used in +conjunction with `restore()` to persist user settings and bookmarks, but +the `PerspectiveViewerConfig` object returned in `json` format can also +be written by hand quite easily, which is useful for authoring +pre-conceived configs. -**`example`** +**`example`** ```javascript const viewer = document.querySelector("perspective-viewer"); -const editport = await viewer.getEditPort(); -const table = await viewer.getTable(); -const view = await table.view(); -view.on_update(obj => { - if (obj.port_id = editport) { - console.log("User edit detected"); - } -}); +const token = await viewer.save("string"); +localStorage.setItem("viewer_state", token); ``` #### Returns -`Promise`<`number`\> +`Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> -A promise which resolves to the current edit port. +a serialized element in the chosen format. #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:366](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L366) - -___ - -### notifyResize +[rust/perspective-viewer/src/ts/viewer.ts:230](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L230) -▸ **notifyResize**(): `Promise`<`void`\> +▸ **save**(`format`): `Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> -Redraw this `` and plugin when its dimensions or -visibility have been updated. This method _must_ be called in these -cases, and will not by default respond to dimension or style changes to -its parent container. `notifyResize()` does not recalculate the current -`View`, but all plugins will re-request the data window (which itself -may be smaller or larger due to resize). +#### Parameters -**`example`** -```javascript -const viewer = document.querySelector("perspective-viewer"); -window.addEventListener("resize", () => viewer.notifyResize()); -``` +| Name | Type | +| :------ | :------ | +| `format` | ``"json"`` | #### Returns -`Promise`<`void`\> - -A `Promise` which resolves when this resize event has -finished rendering. +`Promise`<[`PerspectiveViewerConfig`](#perspectiveviewerconfig)\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:137](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L137) - -___ +[rust/perspective-viewer/src/ts/viewer.ts:231](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L231) -### restyleElement +▸ **save**(`format`): `Promise`<`ArrayBuffer`\> -▸ **restyleElement**(): `Promise`<`void`\> +#### Parameters -Restyles the elements and to pick up any style changes. While most of -perspective styling is plain CSS and can be updated at any time, some -CSS rules are read and cached, e.g. the series colors for -`@finos/perspective-viewer-d3fc` which are read from CSS then reapplied -as SVG and Canvas attributes. +| Name | Type | +| :------ | :------ | +| `format` | ``"arraybuffer"`` | #### Returns -`Promise`<`void`\> +`Promise`<`ArrayBuffer`\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:339](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L339) - -___ - -### setThrottle - -▸ **setThrottle**(`value?`): `Promise`<`void`\> - -Determines the render throttling behavior. Can be an integer, for -millisecond window to throttle render event; or, if `undefined`, -will try to determine the optimal throttle time from this component's -render framerate. +[rust/perspective-viewer/src/ts/viewer.ts:232](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L232) -**`example`** -```javascript -await viewer.setThrottle(1000); -``` +▸ **save**(`format`): `Promise`<`string`\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `value?` | `number` | an optional throttle rate in milliseconds (integer). If not supplied, adaptive throttling is calculated from the average plugin render time. | +| Name | Type | +| :------ | :------ | +| `format` | ``"string"`` | #### Returns -`Promise`<`void`\> +`Promise`<`string`\> #### Defined in -[rust/perspective-viewer/src/ts/viewer.ts:387](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/viewer.ts#L387) - +[rust/perspective-viewer/src/ts/viewer.ts:233](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L233) -# Interface: IPerspectiveViewerPlugin - -The `IPerspectiveViewerPlugin` interface defines the necessary API for a -`` plugin, which also must be an `HTMLElement` via the -Custom Elements API or otherwise. Rather than implement this API from -scratch however, the simplest way is to inherit from -``, which implements `IPerspectiveViewerPlugin` -with non-offensive default implementations, where only the `draw()` and -`name()` methods need be overridden to get started with a simple plugin. +___ -Note that plugins are frozen once a `` has been -instantiated, so generally new plugin code must be executed at the module -level (if packaged as a library), or during application init to ensure global -availability of a plugin. +## Plugin Methods -**`example`** -```javascript -const BasePlugin = customElements.get("perspective-viewer-plugin"); -class MyPlugin extends BasePlugin { - get name() { - return "My Plugin"; - } - async draw(view) { - const count = await view.num_rows(); - this.innerHTML = `View has ${count} rows`; - } -} +### getAllPlugins -customElements.define("my-plugin", MyPlugin); -const Viewer = customElements.get("perspective-viewer"); -Viewer.registerPlugin("my-plugin"); -``` +▸ **getAllPlugins**(): `Promise`<`HTMLElement`[]\> -## Hierarchy +Get all plugin custom element instances, in order of registration. -- `HTMLElement` +If no plugins have been registered (via `registerPlugin()`), calling +`getAllPlugins()` will cause `perspective-viewer-plugin` to be registered +as a side effect. - ↳ **`IPerspectiveViewerPlugin`** +#### Returns -## Implemented by +`Promise`<`HTMLElement`[]\> -- [`PerspectiveViewerPluginElement`](#`PerspectiveViewerPluginElement`) +An `Array` of the plugin instances for this +``. -## Table of contents +#### Defined in -### Accessors +[rust/perspective-viewer/src/ts/viewer.ts:450](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L450) -- [config\_column\_names](#config_column_names) -- [min\_config\_columns](#min_config_columns) -- [name](#name) -- [select\_mode](#select_mode) +___ -### Methods +### getPlugin -- [clear](#clear) -- [delete](#delete) -- [draw](#draw) -- [resize](#resize) -- [restore](#restore) -- [restyle](#restyle) -- [save](#save) -- [update](#update) +▸ **getPlugin**(`name?`): `Promise`<`HTMLElement`\> -## Accessors +Get the currently active plugin custom element instance, or a specific +named instance if requested. `getPlugin(name)` does not activate the +plugin requested, so if this plugin is not active the returned +`HTMLElement` will not have a `parentElement`. -### config\_column\_names +If no plugins have been registered (via `registerPlugin()`), calling +`getPlugin()` will cause `perspective-viewer-plugin` to be registered as +a side effect. -• `get` **config_column_names**(): `string`[] +#### Parameters -The named column labels, if desired. Named columns behave differently -in drag/drop mode than unnamed columns, having replace/swap behavior -rather than insert. If provided, the length of `config_column_names` -_must_ be `>= min_config_columns`, as this is assumed by the drag/drop -logic. +| Name | Type | Description | +| :------ | :------ | :------ | +| `name?` | `string` | Optionally a specific plugin name, defaulting to the current active plugin. | #### Returns -`string`[] +`Promise`<`HTMLElement`\> + +The active or requested plugin instance. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:80](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L80) +[rust/perspective-viewer/src/ts/viewer.ts:433](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L433) ___ -### min\_config\_columns +### registerPlugin -• `get` **min_config_columns**(): `number` +▸ `Static` **registerPlugin**(`name`): `Promise`<`void`\> -The minimum number of columns required for this plugin to operate. -This mostly affects drag/drop and column remove button behavior, -preventing the use from applying configs which violate this min. +Register a new plugin via its custom element name. This method is called +automatically as a side effect of importing a plugin module, so this +method should only typically be called by plugin authors. -While this option can technically be `undefined` (as in the case of -`@finos/perspective-viewer-datagrid`), doing so currently has nearly -identical behavior to 1. +**`example`** +```javascript +customElements.get("perspective-viewer").registerPlugin("my-plugin"); +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | The `name` of the custom element to register, as supplied to the `customElements.define(name)` method. | #### Returns -`number` +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:71](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L71) +[rust/perspective-viewer/src/ts/viewer.ts:87](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L87) ___ -### name +## UI Action Methods -• `get` **name**(): `string` +### copy -The name for this plugin, which is used as both it's unique key for use -as a parameter for the `plugin` field of a `ViewerConfig`, and as the -display name for this plugin in the `` UI. +▸ **copy**(`flat`): `Promise`<`void`\> + +Copies this element's view data (as a CSV) to the clipboard. This method +must be called from an event handler, subject to the browser's +restrictions on clipboard access. See +[https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard](https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard). + +**`example`** +```javascript +const viewer = document.querySelector("perspective-viewer"); +const button = document.querySelector("button"); +button.addEventListener("click", async () => { + await viewer.copy(); +}); +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `flat` | `boolean` | Whether to use the element's current view config, or to use a default "flat" view. | #### Returns -`string` +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:52](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L52) +[rust/perspective-viewer/src/ts/viewer.ts:327](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L327) ___ -### select\_mode +### download -• `get` **select_mode**(): ``"select"`` \| ``"toggle"`` +▸ **download**(`flat`): `Promise`<`void`\> -Select mode determines how column add/remove buttons behave for this -plugin. `"select"` mode exclusively selects the added column, removing -other columns. `"toggle"` mode toggles the column on or off (dependent -on column state), leaving existing columns alone. +Download this element's data as a CSV file. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `flat` | `boolean` | Whether to use the element's current view config, or to use a default "flat" view. | #### Returns -``"select"`` \| ``"toggle"`` +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:60](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L60) +[rust/perspective-viewer/src/ts/viewer.ts:304](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L304) -## Methods +___ -### clear +### toggleConfig -▸ **clear**(): `Promise`<`void`\> +▸ **toggleConfig**(`force?`): `Promise`<`void`\> -Clear this plugin, though it is up to the discretion of the plugin -author to determine what this means. Defaults to resetting this -element's `innerHTML`, so be sure to override if you want custom -behavior. +Opens/closes the element's config menu, equivalent to clicking the +settings button in the UI. This method is equivalent to +`viewer.restore({settings: force})` when `force` is present, but +`restore()` cannot toggle as `toggleConfig()` can, you would need to +first read the settings state from `save()` otherwise. + +Calling `toggleConfig()` may be delayed if an async render is currently +in process, and it may only partially render the UI if `load()` has not +yet resolved. **`example`** ```javascript -async clear(): Promise { - this.innerHTML = ""; -} +await viewer.toggleConfig(); ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `force?` | `boolean` | If supplied, explicitly set the config state to "open" (`true`) or "closed" (`false`). | + #### Returns `Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:124](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L124) +[rust/perspective-viewer/src/ts/viewer.ts:413](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L413) ___ +## Util Methods + ### delete ▸ **delete**(): `Promise`<`void`\> -Free any resources acquired by this plugin and prepare to be deleted. +Deletes this element and clears it's internal state (but not its +user state). This (or the underlying `perspective.view`'s equivalent +method) must be called in order for its memory to be reclaimed, as well +as the reciprocal method on the `perspective.table` which this viewer is +bound to. #### Returns @@ -863,142 +859,146 @@ Free any resources acquired by this plugin and prepare to be deleted. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:159](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L159) +[rust/perspective-viewer/src/ts/viewer.ts:292](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L292) ___ -### draw +### flush -▸ **draw**(`view`): `Promise`<`void`\> +▸ **flush**(): `Promise`<`void`\> -Render this plugin using the provided `View`. While there is no -provision to cancel a render in progress per se, calling a method on -a `View` which has been deleted will throw an exception. +Flush any pending modifications to this ``. Since +``'s API is almost entirely `async`, it may take +some milliseconds before any method call such as `restore()` affects +the rendered element. If you want to make sure any invoked method which +affects the rendered has had its results rendered, call and await +`flush()` -**`example`** -``` -async draw(view: perspective.View): Promise { - const csv = await view.to_csv(); - this.innerHTML = `
${csv}
`; -} +**`example`**
+```javascript +const viewer = document.querySelector("perspective-viewer"); +viewer.restore({row_pivots: ["State"]}); +await viewer.flush(); +console.log("Viewer has been rendered with a pivot!"); ``` -#### Parameters - -| Name | Type | -| :------ | :------ | -| `view` | `View` | - #### Returns `Promise`<`void`\> -#### Defined in - -[rust/perspective-viewer/src/ts/plugin.ts:95](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L95) - -___ - -### resize - -▸ **resize**(): `Promise`<`void`\> - -Like `update()`, but for when the dimensions of the plugin have changed -and the underlying data has not. - -#### Returns - -`Promise`<`void`\> +A promise which resolves when the current +pending state changes have been applied and rendered. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:130](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L130) +[rust/perspective-viewer/src/ts/viewer.ts:261](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L261) ___ -### restore - -▸ **restore**(`config`): `Promise`<`void`\> +### getEditPort -Restore this plugin to a state previously returned by `save()`. +▸ **getEditPort**(): `Promise`<`number`\> -#### Parameters +Gets the edit port, the port number for which `Table` updates from this +`` are generated. This port number will be present +in the options object for a `View.on_update()` callback for any update +which was originated by the ``/user, which can be +used to distinguish server-originated updates from user edits. -| Name | Type | -| :------ | :------ | -| `config` | `any` | +**`example`** +```javascript +const viewer = document.querySelector("perspective-viewer"); +const editport = await viewer.getEditPort(); +const table = await viewer.getTable(); +const view = await table.view(); +view.on_update(obj => { + if (obj.port_id = editport) { + console.log("User edit detected"); + } +}); +``` #### Returns -`Promise`<`void`\> +`Promise`<`number`\> + +A promise which resolves to the current edit port. #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:154](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L154) +[rust/perspective-viewer/src/ts/viewer.ts:368](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L368) ___ -### restyle +### notifyResize -▸ **restyle**(): `Promise`<`void`\> +▸ **notifyResize**(): `Promise`<`void`\> -Notify the plugin that the style environment has changed. Useful for -plugins which read CSS styles via `window.getComputedStyle()`. +Redraw this `` and plugin when its dimensions or +visibility have been updated. This method _must_ be called in these +cases, and will not by default respond to dimension or style changes to +its parent container. `notifyResize()` does not recalculate the current +`View`, but all plugins will re-request the data window (which itself +may be smaller or larger due to resize). + +**`example`** +```javascript +const viewer = document.querySelector("perspective-viewer"); +window.addEventListener("resize", () => viewer.notifyResize()); +``` #### Returns `Promise`<`void`\> +A `Promise` which resolves when this resize event has +finished rendering. + #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:136](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L136) +[rust/perspective-viewer/src/ts/viewer.ts:139](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L139) ___ -### save - -▸ **save**(): `Promise`<`any`\> +### restyleElement -Save this plugin's state to a JSON-serializable value. While this value -can be anything, it should work reciprocally with `restore()` to return -this plugin's renderer to the same state, though potentially with a -different `View`. +▸ **restyleElement**(): `Promise`<`void`\> -`save()` should be used for user-persistent settings that are -data-agnostic, so the user can have persistent view during refresh or -reload. For example, `@finos/perspective-viewer-d3fc` uses -`plugin_config` to remember the user-repositionable legend coordinates. +Restyles the elements and to pick up any style changes. While most of +perspective styling is plain CSS and can be updated at any time, some +CSS rules are read and cached, e.g. the series colors for +`@finos/perspective-viewer-d3fc` which are read from CSS then reapplied +as SVG and Canvas attributes. #### Returns -`Promise`<`any`\> +`Promise`<`void`\> #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:149](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L149) +[rust/perspective-viewer/src/ts/viewer.ts:341](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L341) ___ -### update +### setThrottle -▸ **update**(`view`): `Promise`<`void`\> +▸ **setThrottle**(`value?`): `Promise`<`void`\> -Draw under the assumption that the `ViewConfig` has not changed since -the previous call to `draw()`, but the underlying data has. Defaults to -dispatch to `draw()`. +Determines the render throttling behavior. Can be an integer, for +millisecond window to throttle render event; or, if `undefined`, +will try to determine the optimal throttle time from this component's +render framerate. -**`example`** +**`example`** ```javascript -async update(view: perspective.View): Promise { - return this.draw(view); -} +await viewer.setThrottle(1000); ``` #### Parameters -| Name | Type | -| :------ | :------ | -| `view` | `View` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `value?` | `number` | an optional throttle rate in milliseconds (integer). If not supplied, adaptive throttling is calculated from the average plugin render time. | #### Returns @@ -1006,6 +1006,6 @@ async update(view: perspective.View): Promise { #### Defined in -[rust/perspective-viewer/src/ts/plugin.ts:109](https://github.com/finos/perspective/blob/ebced4caa/rust/perspective-viewer/src/ts/plugin.ts#L109) +[rust/perspective-viewer/src/ts/viewer.ts:389](https://github.com/finos/perspective/blob/e19cc4010/rust/perspective-viewer/src/ts/viewer.ts#L389) diff --git a/rust/perspective-viewer/package.json b/rust/perspective-viewer/package.json index 3858abfbd6..cc811b0e04 100644 --- a/rust/perspective-viewer/package.json +++ b/rust/perspective-viewer/package.json @@ -1,6 +1,6 @@ { "name": "@finos/perspective-viewer", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "The `` Custom Element, frontend for Perspective.js", "repository": { "type": "git", @@ -51,7 +51,7 @@ "access": "public" }, "dependencies": { - "@finos/perspective": "^1.0.0-rc.2", + "@finos/perspective": "^1.0.0", "mobile-drag-drop-shadow-dom": "3.0.0", "monaco-editor": "0.24.0", "monaco-editor-webpack-plugin": "3.1.0" diff --git a/yarn.lock b/yarn.lock index f150fe8056..4bef328a61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7750,13 +7750,6 @@ expect@^25.5.0: jest-message-util "^25.5.0" jest-regex-util "^25.2.6" -express-ws@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/express-ws/-/express-ws-4.0.0.tgz#dabd8dc974516418902a41fe6e30ed949b4d36c4" - integrity sha512-KEyUw8AwRET2iFjFsI1EJQrJ/fHeGiJtgpYgEWG3yDv4l/To/m3a2GaYfeGyB3lsWdvbesjF5XCMx+SVBgAAYw== - dependencies: - ws "^5.2.0" - express@^4.17.1: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" @@ -17744,13 +17737,6 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -ws@^5.2.0: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" - ws@^6.1.2, ws@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb"
Share a `Table`Load perspective.tableLoad PromiseRestore a viewer from `localStorage`Save a viewer to `localStorage`Share a `Table`Load perspective.tableLoad PromiseFlush an unawaited `restore()`Restore a viewer from `localStorage`Save a viewer to `localStorage`Bind `notfyResize()` to browser dimensionsLimit FPS to 1 frame per secondFlush an unawaited `restore()`Bind `notfyResize()` to browser dimensionsLimit FPS to 1 frame per second