dotdata_widgets 0.0.28-dev.70.bfd2f27f

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 (91) hide show
  1. package/README.md +86 -0
  2. package/css/colors.css +124 -0
  3. package/css/typography.css +44 -0
  4. package/css/widget.css +87 -0
  5. package/dist/index.js +76 -0
  6. package/lib/components/accordion/Accordion.js +51 -0
  7. package/lib/components/accordion/index.js +18 -0
  8. package/lib/extension.js +31 -0
  9. package/lib/feature/feature-details/FeatureCorrelatedFeaturesTable.js +22 -0
  10. package/lib/feature/feature-details/FeatureDistributionChart.js +218 -0
  11. package/lib/feature/feature-details/FeatureStatisticsTable.js +44 -0
  12. package/lib/feature/feature-details/index.js +20 -0
  13. package/lib/feature/feature-explanation/FeatureExplanation.js +52 -0
  14. package/lib/feature/feature-explanation/components/ColoredExplanationBlock.js +30 -0
  15. package/lib/feature/feature-explanation/components/ColumnExplanationBlock.js +11 -0
  16. package/lib/feature/feature-explanation/components/DataSlotExplanationBlock.js +11 -0
  17. package/lib/feature/feature-explanation/components/PetExplanationBlock.js +11 -0
  18. package/lib/feature/feature-explanation/components/TextExplanationBlock.js +12 -0
  19. package/lib/feature/feature-explanation/components/TextWithDataSlotContextExplanationBlock.js +10 -0
  20. package/lib/feature/feature-explanation/components/TopicExplanationBlock.js +10 -0
  21. package/lib/feature/feature-explanation/components/UnknownExplanationBlock.js +10 -0
  22. package/lib/feature/feature-likes/feature-likes.js +44 -0
  23. package/lib/feature/feature-likes/index.js +18 -0
  24. package/lib/feature-descriptor/domains-descriptions-tree/components/column-tree-item.js +16 -0
  25. package/lib/feature-descriptor/domains-descriptions-tree/components/descriptions-tree-item.js +51 -0
  26. package/lib/feature-descriptor/domains-descriptions-tree/components/index.js +18 -0
  27. package/lib/feature-descriptor/domains-descriptions-tree/components/tree-item-label.js +54 -0
  28. package/lib/feature-descriptor/domains-descriptions-tree/components/type-tree-item.js +19 -0
  29. package/lib/feature-descriptor/domains-descriptions-tree/config/index.js +11 -0
  30. package/lib/feature-descriptor/domains-descriptions-tree/context/domains-descriptions-selection-context.js +54 -0
  31. package/lib/feature-descriptor/domains-descriptions-tree/context/domains-descriptions-tree-config-context.js +42 -0
  32. package/lib/feature-descriptor/domains-descriptions-tree/context/domains-descriptions-tree-item-selection-context.js +56 -0
  33. package/lib/feature-descriptor/domains-descriptions-tree/context/index.js +20 -0
  34. package/lib/feature-descriptor/domains-descriptions-tree/domains-descriptions-tree.js +44 -0
  35. package/lib/feature-descriptor/domains-descriptions-tree/index.js +21 -0
  36. package/lib/feature-descriptor/domains-descriptions-tree/models/domains-descriptions-tree.model.js +37 -0
  37. package/lib/feature-descriptor/domains-descriptions-tree/models/index.js +18 -0
  38. package/lib/feature-descriptor/domains-descriptions-tree/utils/create-domain-predicate.js +16 -0
  39. package/lib/feature-descriptor/domains-descriptions-tree/utils/filter-domains-descriptions-tree.js +23 -0
  40. package/lib/feature-descriptor/domains-descriptions-tree/utils/index.js +19 -0
  41. package/lib/feature-descriptor/feature-exploration-path/exploration-path-header.js +38 -0
  42. package/lib/feature-descriptor/feature-exploration-path/exploration-path-join-list.js +28 -0
  43. package/lib/feature-descriptor/feature-exploration-path/index.js +19 -0
  44. package/lib/index.js +21 -0
  45. package/lib/models/column/column.js +3 -0
  46. package/lib/models/column/index.js +18 -0
  47. package/lib/models/feature/feature-histogram.js +20 -0
  48. package/lib/models/feature/feature-metric.js +16 -0
  49. package/lib/models/feature/feature.js +3 -0
  50. package/lib/models/feature/index.js +20 -0
  51. package/lib/models/feature-descriptor-domain/fd-domains-description.js +15 -0
  52. package/lib/models/feature-descriptor-domain/fd-join-description.js +3 -0
  53. package/lib/models/feature-descriptor-domain/index.js +19 -0
  54. package/lib/models/feature-explanation/feature-explanation.model.js +30 -0
  55. package/lib/models/feature-explanation/index.js +18 -0
  56. package/lib/models/feature-leaderboard/feature-leaderboard.js +3 -0
  57. package/lib/models/feature-leaderboard/index.js +18 -0
  58. package/lib/models/feature-space/exploration-path.js +3 -0
  59. package/lib/models/feature-space/feature-space.js +3 -0
  60. package/lib/models/feature-space/grouped-domains-descriptions.js +3 -0
  61. package/lib/models/feature-space/index.js +20 -0
  62. package/lib/plugin.js +54 -0
  63. package/lib/utils/asserations.js +10 -0
  64. package/lib/utils/index.js +20 -0
  65. package/lib/utils/localize.js +18 -0
  66. package/lib/utils/model-transform-hook.js +21 -0
  67. package/lib/utils/object/extract-property.js +11 -0
  68. package/lib/utils/object/index.js +19 -0
  69. package/lib/utils/object/is-set.js +12 -0
  70. package/lib/utils/set.js +14 -0
  71. package/lib/utils/transducer.js +16 -0
  72. package/lib/utils/widget-model/index.js +19 -0
  73. package/lib/utils/widget-model/widget-model-context.js +42 -0
  74. package/lib/utils/widget-model/widget-model.js +30 -0
  75. package/lib/utils/widget-theme/index.js +18 -0
  76. package/lib/utils/widget-theme/widget-theme.js +99 -0
  77. package/lib/version.js +21 -0
  78. package/lib/widgets/FeatureLeaderboardWidget.js +61 -0
  79. package/lib/widgets/FeatureSpaceWidget.js +64 -0
  80. package/lib/widgets/feature-leaderboard/FeatureLeaderboardOverview.js +25 -0
  81. package/lib/widgets/feature-leaderboard/FeatureLeaderboardView.js +45 -0
  82. package/lib/widgets/feature-leaderboard/components/leaderboard-feature-likes.js +50 -0
  83. package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntry.js +19 -0
  84. package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryDetails.js +23 -0
  85. package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryRow.js +23 -0
  86. package/lib/widgets/feature-leaderboard/leaderboard-overview/overview-slider.js +62 -0
  87. package/lib/widgets/feature-space/FeatureDomainsDescriptions.js +74 -0
  88. package/lib/widgets/feature-space/FeatureExplorationPaths.js +16 -0
  89. package/lib/widgets/feature-space/FeatureSpaceView.js +52 -0
  90. package/lib/widgets/index.js +21 -0
  91. package/package.json +119 -0
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Dotdata Widgets
2
+
3
+ Dotdata widgets consist of a NodeJS library and a python module.
4
+
5
+ ## Building the `nodejs` part
6
+
7
+ In order to build the nodejs part of dotdata widgets - follow the `make` targets
8
+ defined in the `Makefile` in this directory.
9
+
10
+ ```bash
11
+ make build_js
12
+ ```
13
+ There is an alias for this command in the root-level `Makefile`:
14
+ ```bash
15
+ make -C ../../ build_widgets_js_for_iff
16
+ ```
17
+
18
+ NOTE: this command might not work if on platforms other than linux.
19
+ The docker container in which the commands are executed is based on `node:18.15` container,
20
+ which assumes that the working user has `UID=1000`.
21
+ Calling it on MacOS may produce artifacts with invalid ownership.
22
+
23
+ In order to build the nodejs package without the docker, make sure you've provisioned your local environment
24
+ as described in the `docker/npm/Dockerfile`. Especially make sure that you have:
25
+
26
+ * node in version >=18
27
+ * yarn (`npm install yarn -g`)
28
+ * python >=3.8
29
+ * jupyterlab
30
+
31
+ Then you may call:
32
+ ```bash
33
+ make -C ../../ build_js_without_docker
34
+ ```
35
+
36
+ ## Publishing the js part of Dotdata Widgets
37
+
38
+ **DO NOT publish the nodejs package unless you're sure what you're doing!**
39
+
40
+ Dotdata Widgets are published in a public npm repository.
41
+ You can browse the published packages at https://www.npmjs.com/package/dotdata_widgets
42
+
43
+ Dotdata widgets are published together with the dotdata wheel by the jenkins job,
44
+ which calls `make publish_iff` from the root-level `Makefile`.
45
+ This command refers to the npm `publish` command, which utilises credentials to npm registry
46
+ defined in `.npmrc`
47
+
48
+
49
+ ## Interactive development and testing
50
+
51
+ **WARNING: THERE ARE NO AUTOMATED TESTS OF DOTDATA WIDGETS (neither JS nor python part).**
52
+
53
+ Dotdata widgets can be tested manually in a jupyter notebook.
54
+
55
+ In order to do so do the following:
56
+ * Prune local virtual env:
57
+ ```bash
58
+ make -C ../../ prune_iff_test_env
59
+ ```
60
+ This command cleans the venv directory and deletes pre-existing artifacts.
61
+ * Install `dotdata` in dev mode in the local virtual env:
62
+ ```bash
63
+ make -C ../../ prepare_iff_interactive_dev_env
64
+ ```
65
+ This command installs `jupyterlab`, installs `dotdata` in `--editable` mode, and calls `jupyter labextension develop --overwrite ${PATH_TO_DOTDAT_WIDGETS}`.
66
+ Although it make take up to 20 minutes, it has to be called only once.
67
+ * Launch widgets compilation server:
68
+ ```bash
69
+ make -C ../../ _run_yarn_watch_compilation_of_dotdata_widgets
70
+ ```
71
+ * NOTE: this command requires `node` and `yarn` to be installed in your environment.
72
+ * Also, it fails if `prepare_iff_interactive_dev_env` wasn't called before.
73
+ * This command spawns a server that watches for changes in the ts files and recompiles them on the fly.
74
+ * Run it in separate terminal.
75
+ * A single recompilation may take up to a minute, so be patient.
76
+ * Launch jupyter lab:
77
+ ```bash
78
+ make -C ../../ _start_jupyterlab
79
+ ```
80
+ * This command spawns a jupyter-lab server. Run it in separate terminal.
81
+ * It also opens a browser window with a jupyter lab workspace.
82
+ * Open a notebook (e.g. `examples/introduction.ipynb`) and work with your widgets.
83
+
84
+ When developing widgets in interactive mode, keep in mind that:
85
+ * you have to reload browser caches in order to force it to load re-compiled `*.js` files.
86
+ * you have to restart notebook's kernel in order to load modified python modules.
package/css/colors.css ADDED
@@ -0,0 +1,124 @@
1
+ :root {
2
+ --c-red-50: #ffebee;
3
+ --c-red-100: #ffcdd2;
4
+ --c-red-200: #ef9a9a;
5
+ --c-red-300: #e57373;
6
+ --c-red-400: #ef5350;
7
+ --c-red-500: #f44336;
8
+ --c-red-600: #e53935;
9
+ --c-red-700: #d32f2f;
10
+ --c-red-800: #c62828;
11
+ --c-red-900: #b71c1c;
12
+ --c-purple-50: #f3e5f5;
13
+ --c-purple-100: #e1bee7;
14
+ --c-purple-200: #ce93d8;
15
+ --c-purple-300: #ba68c8;
16
+ --c-purple-400: #ab47bc;
17
+ --c-purple-500: #9c27b0;
18
+ --c-purple-600: #8e24aa;
19
+ --c-purple-700: #7b1fa2;
20
+ --c-purple-800: #6a1b9a;
21
+ --c-purple-900: #4a148c;
22
+ --c-cyan-50: #e0f7fa;
23
+ --c-cyan-100: #b2ebf2;
24
+ --c-cyan-200: #80deea;
25
+ --c-cyan-300: #4dd0e1;
26
+ --c-cyan-400: #26c6da;
27
+ --c-cyan-500: #00bcd4;
28
+ --c-cyan-600: #00acc1;
29
+ --c-cyan-700: #0097a7;
30
+ --c-cyan-800: #00838f;
31
+ --c-cyan-900: #006064;
32
+ --c-blue-50: #e3f2fd;
33
+ --c-blue-100: #bbdefb;
34
+ --c-blue-200: #90caf9;
35
+ --c-blue-300: #64b5f6;
36
+ --c-blue-400: #42a5f5;
37
+ --c-blue-500: #2196f3;
38
+ --c-blue-600: #1e88e5;
39
+ --c-blue-700: #1976d2;
40
+ --c-blue-800: #1565c0;
41
+ --c-blue-900: #0d47a1;
42
+ --c-light-blue-50: #e1f5fe;
43
+ --c-light-blue-100: #b3e5fc;
44
+ --c-light-blue-200: #81d4fa;
45
+ --c-light-blue-300: #4fc3f7;
46
+ --c-light-blue-400: #29b6f6;
47
+ --c-light-blue-500: #03a9f4;
48
+ --c-light-blue-600: #039be5;
49
+ --c-light-blue-700: #0288d1;
50
+ --c-light-blue-800: #0277bd;
51
+ --c-light-blue-900: #01579b;
52
+ --c-green-50: #e8f5e9;
53
+ --c-green-100: #c8e6c9;
54
+ --c-green-200: #a5d6a7;
55
+ --c-green-300: #81c784;
56
+ --c-green-400: #66bb6a;
57
+ --c-green-500: #4caf50;
58
+ --c-green-600: #43a047;
59
+ --c-green-700: #388e3c;
60
+ --c-green-800: #2e7d32;
61
+ --c-light-green-50: #f1f8e9;
62
+ --c-light-green-100: #dcedc8;
63
+ --c-light-green-200: #c5e1a5;
64
+ --c-light-green-300: #aed581;
65
+ --c-light-green-400: #9ccc65;
66
+ --c-light-green-500: #8bc34a;
67
+ --c-light-green-600: #7cb342;
68
+ --c-light-green-700: #689f38;
69
+ --c-light-green-800: #558b2f;
70
+ --c-light-green-900: #33691e;
71
+ --c-yellow-50: #fffde7;
72
+ --c-yellow-100: #fff9c4;
73
+ --c-yellow-200: #fff59d;
74
+ --c-yellow-300: #fff176;
75
+ --c-yellow-400: #ffee58;
76
+ --c-yellow-500: #ffeb3b;
77
+ --c-yellow-600: #fdd835;
78
+ --c-yellow-700: #fbc02d;
79
+ --c-yellow-800: #f9a825;
80
+ --c-yellow-900: #f57f17;
81
+ --c-amber-100: #ffecb3;
82
+ --c-amber-200: #ffe082;
83
+ --c-amber-300: #ffd54f;
84
+ --c-amber-400: #ffca28;
85
+ --c-amber-500: #ffc107;
86
+ --c-amber-600: #ffb300;
87
+ --c-amber-700: #ffa000;
88
+ --c-amber-800: #ff8f00;
89
+ --c-amber-900: #ff6f00;
90
+ --c-orange-50: #fff3e0;
91
+ --c-orange-100: #ffe0b2;
92
+ --c-orange-200: #ffcc80;
93
+ --c-orange-300: #ffb74d;
94
+ --c-orange-400: #ffa726;
95
+ --c-orange-500: #ff9800;
96
+ --c-orange-600: #fb8c00;
97
+ --c-orange-700: #f57c00;
98
+ --c-orange-800: #ef6c00;
99
+ --c-orange-900: #e65100;
100
+ --c-brown-50: #efebe9;
101
+ --c-brown-100: #d7ccc8;
102
+ --c-brown-200: #bcaaa4;
103
+ --c-brown-300: #a1887f;
104
+ --c-brown-400: #8d6e63;
105
+ --c-brown-500: #795548;
106
+ --c-brown-600: #6d4c41;
107
+ --c-brown-700: #5d4037;
108
+ --c-brown-800: #4e342e;
109
+ --c-brown-900: #3e2723;
110
+ --c-grey-50: #fafafa;
111
+ --c-grey-100: #f5f5f5;
112
+ --c-grey-200: #eee;
113
+ --c-grey-300: #e0e0e0;
114
+ --c-grey-400: #bdbdbd;
115
+ --c-grey-500: #9e9e9e;
116
+ --c-grey-600: #757575;
117
+ --c-grey-700: #616161;
118
+ --c-grey-800: #424242;
119
+ --c-grey-900: #212121;
120
+
121
+ --c-catskill-white: #f5f7fa;
122
+ --c-zircon: #EDF3FF;
123
+ --c-cornflower-blue: #5B92FB
124
+ }
@@ -0,0 +1,44 @@
1
+ h1,
2
+ .h1 {
3
+ font-size: 24px;
4
+ font-weight: 400;
5
+ line-height: 20px;
6
+ letter-spacing: 0;
7
+ }
8
+
9
+ h2,
10
+ .h2 {
11
+ font-size: 20px;
12
+ font-weight: 400;
13
+ line-height: 30px;
14
+ letter-spacing: 0;
15
+ }
16
+
17
+ h3,
18
+ .h3 {
19
+ font-size: 18px;
20
+ font-weight: 400;
21
+ line-height: 26px;
22
+ letter-spacing: 0;
23
+ }
24
+
25
+ h4,
26
+ .h4 {
27
+ font-size: 16px;
28
+ line-height: 20px;
29
+ letter-spacing: 0;
30
+ font-weight: 500;
31
+ margin-block: 12px;
32
+ }
33
+
34
+ .label {
35
+ font-size: 14px;
36
+ font-weight: 400;
37
+ line-height: 20px;
38
+ }
39
+
40
+ .label-bold {
41
+ font-size: 14px;
42
+ font-weight: 500;
43
+ line-height: 20px;
44
+ }
package/css/widget.css ADDED
@@ -0,0 +1,87 @@
1
+ @import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap');
2
+
3
+ @import url('colors.css');
4
+ @import url('typography.css');
5
+
6
+ @import url('../src/feature-descriptor/feature-descriptors-domain.css');
7
+ @import url('../src/components/accordion/accordion.css');
8
+ @import url('../src/widgets/feature-space/feature-space.css');
9
+ @import url('../src/widgets/feature-leaderboard/feature-leaderboard.css');
10
+
11
+ :root {
12
+ --c-text: black;
13
+
14
+ /* TABLE */
15
+ --table-border-color: var(--c-grey-300);
16
+ --table-header-color: var(--c-grey-600);
17
+ --table-row-height: 30px;
18
+ }
19
+
20
+ .dotdata-widget {
21
+ font-family: Roboto, serif;
22
+ font-size: 14px;
23
+ line-height: 16px;
24
+ color: var(--c-text);
25
+ overflow-x: auto;
26
+ margin-top: 24px;
27
+ }
28
+
29
+ /************ DARK MODE *************/
30
+ /* Databricks*/
31
+ body.dark-mode .dotdata-widget,
32
+ /* VSCODE */
33
+ .vscode-dark .dotdata-widget,
34
+ /* Jupyter */
35
+ body[data-jp-theme-light="false"] .dotdata-widget {
36
+ filter: invert(1) saturate(0.5) !important;
37
+ }
38
+
39
+ .dotdata-widget ::-webkit-scrollbar {
40
+ width: 4px;
41
+ }
42
+
43
+ .dotdata-widget ::-webkit-scrollbar-track {
44
+ background: var(--c-grey-300);
45
+ border-radius: 0;
46
+ }
47
+
48
+ .dotdata-widget ::-webkit-scrollbar-thumb {
49
+ background: var(--c-cornflower-blue);
50
+ border-radius: 4px;
51
+ }
52
+
53
+ h1,
54
+ h2,
55
+ h3 {
56
+ margin-block: 0.4em;
57
+ }
58
+
59
+ .grey-label {
60
+ color: var(--c-grey-700);
61
+ }
62
+
63
+ .text-ellipsis {
64
+ text-overflow: ellipsis;
65
+ white-space: nowrap;
66
+ overflow: hidden;
67
+ }
68
+
69
+ .table {
70
+ border-collapse: collapse;
71
+ border-spacing: 0;
72
+ }
73
+
74
+ .table :is(th, td) {
75
+ padding: 0.3rem;
76
+ min-width: 50px;
77
+ }
78
+
79
+ .table :is(tr) {
80
+ height: var(--table-row-height);
81
+ }
82
+
83
+ .table th {
84
+ color: var(--table-header-color);
85
+ border-bottom: 1px solid var(--c-grey-300);
86
+ text-align: start;
87
+ }