hiplot-mm 0.0.1__py3-none-any.whl → 0.0.3rc0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. hiplot/ipython.py +38 -6
  2. hiplot/pkginfo.py +18 -2
  3. hiplot/server.py +8 -2
  4. hiplot/static/built/hiplot.bundle.js +1 -1
  5. hiplot/static/built/streamlit_component/hiplot_streamlit.bundle.js +1 -1
  6. hiplot/streamlit_helpers.py +11 -2
  7. {hiplot_mm-0.0.1.dist-info → hiplot_mm-0.0.3rc0.dist-info}/METADATA +51 -27
  8. hiplot_mm-0.0.3rc0.dist-info/RECORD +33 -0
  9. {hiplot_mm-0.0.1.dist-info → hiplot_mm-0.0.3rc0.dist-info}/WHEEL +1 -1
  10. {hiplot_mm-0.0.1.dist-info → hiplot_mm-0.0.3rc0.dist-info}/entry_points.txt +0 -1
  11. hiplot/static/built/component.d.ts +0 -109
  12. hiplot/static/built/component.js +0 -528
  13. hiplot/static/built/contextmenu.d.ts +0 -26
  14. hiplot/static/built/contextmenu.js +0 -90
  15. hiplot/static/built/controls.d.ts +0 -52
  16. hiplot/static/built/controls.js +0 -163
  17. hiplot/static/built/filters.d.ts +0 -21
  18. hiplot/static/built/filters.js +0 -96
  19. hiplot/static/built/header.d.ts +0 -39
  20. hiplot/static/built/header.js +0 -176
  21. hiplot/static/built/hiplot-mm-0.0.0.tar.gz +0 -0
  22. hiplot/static/built/hiplot.bundle.js.LICENSE.txt +0 -88
  23. hiplot/static/built/hiplot.bundle.js.map +0 -1
  24. hiplot/static/built/hiplot.d.ts +0 -8
  25. hiplot/static/built/hiplot.js +0 -14
  26. hiplot/static/built/hiplot.lib.js +0 -57712
  27. hiplot/static/built/hiplot.lib.js.map +0 -1
  28. hiplot/static/built/hiplot.licenses.txt +0 -682
  29. hiplot/static/built/hiplot_mm-0.0.0-py3-none-any.whl +0 -0
  30. hiplot/static/built/hiplot_streamlit.bundle.js +0 -3
  31. hiplot/static/built/hiplot_streamlit.bundle.js.LICENSE.txt +0 -97
  32. hiplot/static/built/hiplot_streamlit.bundle.js.map +0 -1
  33. hiplot/static/built/hiplot_streamlit.d.ts +0 -1
  34. hiplot/static/built/hiplot_streamlit.js +0 -85
  35. hiplot/static/built/hiplot_streamlit.licenses.txt +0 -689
  36. hiplot/static/built/hiplot_test.bundle.js +0 -3
  37. hiplot/static/built/hiplot_test.bundle.js.LICENSE.txt +0 -88
  38. hiplot/static/built/hiplot_test.bundle.js.map +0 -1
  39. hiplot/static/built/hiplot_test.d.ts +0 -46
  40. hiplot/static/built/hiplot_test.js +0 -238
  41. hiplot/static/built/hiplot_test.licenses.txt +0 -682
  42. hiplot/static/built/hiplot_web.d.ts +0 -3
  43. hiplot/static/built/hiplot_web.js +0 -54
  44. hiplot/static/built/infertypes.d.ts +0 -38
  45. hiplot/static/built/infertypes.js +0 -316
  46. hiplot/static/built/plotxy.d.ts +0 -62
  47. hiplot/static/built/plotxy.js +0 -602
  48. hiplot/static/built/plugin.d.ts +0 -38
  49. hiplot/static/built/plugin.js +0 -8
  50. hiplot/static/built/rowsdisplaytable.d.ts +0 -35
  51. hiplot/static/built/rowsdisplaytable.js +0 -284
  52. hiplot/static/built/streamlit_component/hiplot.bundle.js +0 -3
  53. hiplot/static/built/types.d.ts +0 -64
  54. hiplot/static/built/types.js +0 -55
  55. hiplot_mm-0.0.1.dist-info/RECORD +0 -77
  56. {hiplot_mm-0.0.1.dist-info → hiplot_mm-0.0.3rc0.dist-info/licenses}/LICENSE +0 -0
  57. {hiplot_mm-0.0.1.dist-info → hiplot_mm-0.0.3rc0.dist-info/licenses}/NOTICE +0 -0
  58. {hiplot_mm-0.0.1.dist-info → hiplot_mm-0.0.3rc0.dist-info}/top_level.txt +0 -0
@@ -1,46 +0,0 @@
1
- import { ParallelPlot } from "./parallel/parallel";
2
- import { HiPlotProps, HiPlot } from "./hiplot";
3
- import React from "react";
4
- import { PlotXY } from "./plotxy";
5
- interface TesterState {
6
- testNum: number;
7
- testDone: boolean;
8
- renderNum: number;
9
- width: number;
10
- keepCount: number;
11
- }
12
- export declare class HiPlotTester extends React.Component<{
13
- hiplotProps: HiPlotProps;
14
- }, TesterState> {
15
- root: React.RefObject<HTMLDivElement>;
16
- hiplot: React.RefObject<HiPlot>;
17
- timeout: ReturnType<typeof setTimeout>;
18
- state: {
19
- testNum: number;
20
- testDone: boolean;
21
- renderNum: number;
22
- keepCount: number;
23
- width: number;
24
- };
25
- testSelection: {
26
- name: string;
27
- test: () => void;
28
- }[];
29
- testFn: any[];
30
- testSelect(): void;
31
- testSelectNone(): void;
32
- testSelectAll(): void;
33
- testHighlightAllSelected(): void;
34
- testButton(text: string): void;
35
- testChangeColor(): void;
36
- checkStartTesting(): void;
37
- componentDidMount(): void;
38
- componentDidUpdate(): void;
39
- componentWillUnmount(): void;
40
- simulateRefresh(): void;
41
- render(): JSX.Element;
42
- pplot(): ParallelPlot;
43
- plotxy(): PlotXY;
44
- }
45
- export declare function render(element: HTMLElement, extra?: object): void;
46
- export {};
@@ -1,238 +0,0 @@
1
- /*
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- var __extends = (this && this.__extends) || (function () {
8
- var extendStatics = function (d, b) {
9
- extendStatics = Object.setPrototypeOf ||
10
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
11
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
12
- return extendStatics(d, b);
13
- };
14
- return function (d, b) {
15
- extendStatics(d, b);
16
- function __() { this.constructor = d; }
17
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18
- };
19
- })();
20
- var __assign = (this && this.__assign) || function () {
21
- __assign = Object.assign || function(t) {
22
- for (var s, i = 1, n = arguments.length; i < n; i++) {
23
- s = arguments[i];
24
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
25
- t[p] = s[p];
26
- }
27
- return t;
28
- };
29
- return __assign.apply(this, arguments);
30
- };
31
- var __spreadArrays = (this && this.__spreadArrays) || function () {
32
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
33
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
34
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
35
- r[k] = a[j];
36
- return r;
37
- };
38
- import $ from "jquery";
39
- import * as d3 from "d3";
40
- import { ParallelPlot } from "./parallel/parallel";
41
- import { HiPlot } from "./hiplot";
42
- import React from "react";
43
- import ReactDOM from "react-dom";
44
- import { PlotXY } from "./plotxy";
45
- import { build_props } from "./hiplot_web";
46
- ;
47
- var HiPlotTester = /** @class */ (function (_super) {
48
- __extends(HiPlotTester, _super);
49
- function HiPlotTester() {
50
- var _this = _super !== null && _super.apply(this, arguments) || this;
51
- _this.root = React.createRef();
52
- _this.hiplot = React.createRef();
53
- _this.timeout = null;
54
- _this.state = {
55
- testNum: -1,
56
- testDone: false,
57
- renderNum: 0,
58
- keepCount: 10,
59
- width: 1024
60
- };
61
- _this.testSelection = [
62
- { name: "testSelect", test: _this.testSelect },
63
- { name: "keepBtn", test: function () { this.testButton("Keep"); } },
64
- { name: "kept", test: function () { console.assert(this.hiplot.current.state.rows_filtered.length == this.state.keepCount); } },
65
- { name: "restoreBtn", test: function () { this.testButton("Restore"); } },
66
- { name: "restored", test: function () { console.assert(this.hiplot.current.state.rows_filtered.length != this.state.keepCount); } },
67
- { name: "testSelect", test: _this.testSelect },
68
- { name: "excludeBtn", test: function () { this.testButton("Exclude"); } },
69
- { name: "restoreBtn", test: function () { this.testButton("Restore"); } },
70
- ];
71
- _this.testFn = __spreadArrays([
72
- { name: "responsiveWidth", test: function () { console.assert(this.root.current.scrollWidth == this.state.width); } },
73
- { name: "testSelect", test: _this.testSelect },
74
- { name: "testSelectNone", test: _this.testSelectNone },
75
- { name: "testSelectAll", test: _this.testSelectAll }
76
- ], _this.testSelection, [
77
- { name: "testResize", test: function () { this.setState({ width: 800 }); } },
78
- { name: "testResize2", test: function () { $(window).trigger('resize'); } },
79
- { name: "responsiveWidth", test: function () { console.assert(this.root.current.scrollWidth == this.state.width); } },
80
- { name: "testResize", test: function () { this.setState({ width: 1024 }); } },
81
- { name: "testResize2", test: function () { $(window).trigger('resize'); } },
82
- { name: "changeColor", test: _this.testChangeColor },
83
- { name: "changeColor", test: _this.testChangeColor },
84
- { name: "changeColor", test: _this.testChangeColor },
85
- { name: "changeColor", test: _this.testChangeColor },
86
- { name: "changeColor", test: _this.testChangeColor },
87
- { name: "changeColor", test: _this.testChangeColor },
88
- { name: "changeColor", test: _this.testChangeColor }
89
- ], test_pplot.bind(_this)(), test_plotxy.bind(_this)());
90
- return _this;
91
- }
92
- // Selection/highlights
93
- HiPlotTester.prototype.testSelect = function () {
94
- var allRows = this.hiplot.current.state.rows_filtered;
95
- this.hiplot.current.setSelected(allRows.slice(0, this.state.keepCount));
96
- };
97
- HiPlotTester.prototype.testSelectNone = function () {
98
- this.hiplot.current.setSelected([]);
99
- };
100
- HiPlotTester.prototype.testSelectAll = function () {
101
- var allRows = this.hiplot.current.state.rows_filtered;
102
- this.hiplot.current.setSelected(allRows);
103
- };
104
- HiPlotTester.prototype.testHighlightAllSelected = function () {
105
- this.hiplot.current.setHighlighted(this.hiplot.current.state.rows_selected);
106
- };
107
- // Keep/restore/exclude buttons
108
- HiPlotTester.prototype.testButton = function (text) {
109
- var btn = $(this.root.current).find("button:contains(" + text + ")")[0];
110
- console.assert(btn !== undefined, "Can't find button \"" + text + "\"");
111
- btn.click();
112
- };
113
- HiPlotTester.prototype.testChangeColor = function () {
114
- var s = this.hiplot.current.state;
115
- var params = Object.keys(s.params_def).filter(function (v) { return v != "uid" && v != "from_uid"; });
116
- var newColorIdx = (params.indexOf(s.colorby) + 1) % params.length;
117
- this.hiplot.current.setState({ colorby: params[newColorIdx] });
118
- };
119
- HiPlotTester.prototype.checkStartTesting = function () {
120
- console.log("Waiting for user to load an experiment...");
121
- if (this.hiplot.current.state.experiment) {
122
- clearInterval(this.timeout);
123
- this.setState({
124
- testNum: 0,
125
- keepCount: Math.floor(this.hiplot.current.state.experiment.datapoints.length / 2)
126
- });
127
- }
128
- };
129
- HiPlotTester.prototype.componentDidMount = function () {
130
- this.timeout = setInterval(this.checkStartTesting.bind(this), 500);
131
- };
132
- HiPlotTester.prototype.componentDidUpdate = function () {
133
- if (this.state.testDone) {
134
- return;
135
- }
136
- if (this.state.testNum >= this.testFn.length) {
137
- console.log("Tests done!");
138
- return;
139
- }
140
- this.setState({ testDone: true });
141
- var testDef = this.testFn[this.state.testNum];
142
- console.log("## TEST " + this.state.testNum + ": " + testDef.name);
143
- testDef.test.bind(this)();
144
- this.timeout = setTimeout(this.setState.bind(this, { testNum: this.state.testNum + 1, testDone: false }), 500);
145
- };
146
- HiPlotTester.prototype.componentWillUnmount = function () {
147
- if (this.timeout !== null) {
148
- clearTimeout(this.timeout);
149
- }
150
- };
151
- HiPlotTester.prototype.simulateRefresh = function () {
152
- var exp = this.hiplot.current.state.experiment;
153
- console.assert(exp);
154
- this.hiplot.current.loadWithPromise(new Promise(function (rs, rj) {
155
- rs({
156
- experiment: exp
157
- });
158
- }));
159
- };
160
- HiPlotTester.prototype.render = function () {
161
- return React.createElement("div", { ref: this.root, style: { width: this.state.width } },
162
- React.createElement(HiPlot, __assign({ ref: this.hiplot, key: this.state.renderNum }, this.props.hiplotProps)));
163
- };
164
- HiPlotTester.prototype.pplot = function () {
165
- var pplot = this.hiplot.current.getPlugin(ParallelPlot);
166
- console.assert(pplot);
167
- return pplot;
168
- };
169
- HiPlotTester.prototype.plotxy = function () {
170
- var plotxy = this.hiplot.current.getPlugin(PlotXY);
171
- console.assert(plotxy);
172
- return plotxy;
173
- };
174
- return HiPlotTester;
175
- }(React.Component));
176
- export { HiPlotTester };
177
- ;
178
- function prefix(pre, tests) {
179
- return tests.map(function (val) {
180
- val.name = pre + "_" + val.name;
181
- return val;
182
- });
183
- }
184
- function test_pplot() {
185
- var pplot = this.pplot.bind(this);
186
- function brushIdx(pplot, colIdx) {
187
- var brush_el = d3.select(pplot.svg_ref.current).selectAll(".pplot-brush");
188
- var size = brush_el.nodes().length; // Why does `brush_el.size()` returns 0?!
189
- console.assert(size > 0);
190
- brush_el = brush_el.filter(function (d, i) { return i === colIdx % size; });
191
- pplot.d3brush.move(brush_el, [colIdx % 3 == 0 ? 0 : 100, 200]);
192
- }
193
- var brushKeepRestore = function (colIdx) {
194
- var tests = [
195
- { name: "brush", test: function () { return brushIdx(pplot(), colIdx); } },
196
- ];
197
- if (colIdx % 4 != 0) {
198
- tests.push({ name: "filter", test: function () { this.testButton(colIdx % 3 == 0 ? "Keep" : "Exclude"); } });
199
- tests.push({ name: "restore", test: function () { this.testButton("Restore"); } });
200
- }
201
- tests.push({ name: "clearBrush", test: function () { pplot().brush_clear_all(); } });
202
- return prefix("col" + colIdx, tests);
203
- }.bind(this);
204
- var tests = [];
205
- for (var i = 0; i < 15; ++i) {
206
- tests = tests.concat(brushKeepRestore(i));
207
- }
208
- return prefix("pplot", tests);
209
- }
210
- function test_plotxy() {
211
- var plotxy = this.plotxy.bind(this);
212
- var selectAxis = function (idx) {
213
- var k = Object.keys(this.hiplot.current.state.params_def).filter(function (v) { return v != "uid" && v != "from_uid"; });
214
- return k[idx % k.length];
215
- }.bind(this);
216
- var tests = [
217
- { name: 'enable', test: function () {
218
- plotxy().setState({ axis_x: selectAxis(0), axis_y: selectAxis(1) });
219
- } },
220
- { name: 'change_axis_x', test: function () {
221
- plotxy().setState({ axis_x: selectAxis(2), axis_y: selectAxis(1) });
222
- } },
223
- { name: 'refresh', test: function () {
224
- this.simulateRefresh();
225
- } },
226
- { name: 'axisKept', test: function () {
227
- console.assert(plotxy().state.axis_x == selectAxis(2), "axis_x error: " + plotxy().state);
228
- console.assert(plotxy().state.axis_y == selectAxis(1), "axis_y error: " + plotxy().state);
229
- } }
230
- ];
231
- return prefix("plotxy", tests);
232
- }
233
- export function render(element, extra) {
234
- var props = build_props(extra);
235
- Object.assign(props, { asserts: true });
236
- return ReactDOM.render(React.createElement(React.StrictMode, null,
237
- React.createElement(HiPlotTester, { hiplotProps: props })), element);
238
- }