khiops-visualization 11.1.2 → 11.2.0

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.
@@ -0,0 +1,409 @@
1
+ {
2
+ "tool": "Khiops Coclustering",
3
+ "version": "8.6a",
4
+ "coclusteringReport": {
5
+ "summary": {
6
+ "instances": 1000,
7
+ "cells": 40,
8
+ "nullCost": 10763.32415,
9
+ "cost": 10445.04227,
10
+ "level": 0.0295709649,
11
+ "initialDimensions": 5,
12
+ "frequencyVariable": "",
13
+ "dictionary": "Adult",
14
+ "database": "Adult1000.txt"
15
+ },
16
+ "dimensionSummaries": [
17
+ {
18
+ "name": "occupation",
19
+ "type": "Categorical",
20
+ "parts": 3,
21
+ "initialParts": 3,
22
+ "values": 14,
23
+ "interest": 1,
24
+ "description": ""
25
+ },
26
+ {
27
+ "name": "education_num",
28
+ "type": "Numerical",
29
+ "parts": 2,
30
+ "initialParts": 2,
31
+ "values": 1000,
32
+ "interest": 1,
33
+ "description": "",
34
+ "min": 1,
35
+ "max": 16
36
+ },
37
+ {
38
+ "name": "marital_status",
39
+ "type": "Categorical",
40
+ "parts": 2,
41
+ "initialParts": 2,
42
+ "values": 7,
43
+ "interest": 1,
44
+ "description": ""
45
+ },
46
+ {
47
+ "name": "sex",
48
+ "type": "Categorical",
49
+ "parts": 2,
50
+ "initialParts": 2,
51
+ "values": 2,
52
+ "interest": 1,
53
+ "description": ""
54
+ },
55
+ {
56
+ "name": "class",
57
+ "type": "Categorical",
58
+ "parts": 2,
59
+ "initialParts": 2,
60
+ "values": 2,
61
+ "interest": 1,
62
+ "description": ""
63
+ }
64
+ ],
65
+ "dimensionPartitions": [
66
+ {
67
+ "name": "occupation",
68
+ "type": "Categorical",
69
+ "valueGroups": [
70
+ {
71
+ "cluster": "{Prof-specialty, Exec-managerial, Tech-support, ...}",
72
+ "values": ["Prof-specialty","Exec-managerial","Tech-support","Sales","Protective-serv"],
73
+ "valueFrequencies": [186,124,44,112,16],
74
+ "valueTypicalities": [1,0.908073,0.240546,0.197089,0.0673183]
75
+ },
76
+ {
77
+ "cluster": "{Craft-repair, Transport-moving, Handlers-cleaners, ...}",
78
+ "values": ["Craft-repair","Transport-moving","Handlers-cleaners","Machine-op-inspct","Farming-fishing","Armed-Forces"],
79
+ "valueFrequencies": [126,52,43,61,31,1],
80
+ "valueTypicalities": [1,0.616543,0.30175,0.296152,0.260692,0.0190968]
81
+ },
82
+ {
83
+ "cluster": "{Other-service, Adm-clerical, Priv-house-serv}",
84
+ "values": ["Other-service","Adm-clerical","Priv-house-serv"],
85
+ "valueFrequencies": [107,94,3],
86
+ "valueTypicalities": [1,0.990468,0.0852379]
87
+ }
88
+ ],
89
+ "defaultGroupIndex": 1
90
+ },
91
+ {
92
+ "name": "education_num",
93
+ "type": "Numerical",
94
+ "intervals": [
95
+ {
96
+ "cluster": "]-inf;11.5]",
97
+ "bounds": [1,11.5]
98
+ },
99
+ {
100
+ "cluster": "]11.5;+inf[",
101
+ "bounds": [11.5,16]
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "name": "marital_status",
107
+ "type": "Categorical",
108
+ "valueGroups": [
109
+ {
110
+ "cluster": "{Never-married, Divorced, Widowed, ...}",
111
+ "values": ["Never-married","Divorced","Widowed","Separated","Married-spouse-absent","Married-AF-spouse"],
112
+ "valueFrequencies": [344,136,33,28,15,1],
113
+ "valueTypicalities": [1,0.669163,0.275292,0.188924,0.12265,0.03012]
114
+ },
115
+ {
116
+ "cluster": "{Married-civ-spouse}",
117
+ "values": ["Married-civ-spouse"],
118
+ "valueFrequencies": [443],
119
+ "valueTypicalities": [1]
120
+ }
121
+ ],
122
+ "defaultGroupIndex": 0
123
+ },
124
+ {
125
+ "name": "sex",
126
+ "type": "Categorical",
127
+ "valueGroups": [
128
+ {
129
+ "cluster": "{Male}",
130
+ "values": ["Male"],
131
+ "valueFrequencies": [671],
132
+ "valueTypicalities": [1]
133
+ },
134
+ {
135
+ "cluster": "{Female}",
136
+ "values": ["Female"],
137
+ "valueFrequencies": [329],
138
+ "valueTypicalities": [1]
139
+ }
140
+ ],
141
+ "defaultGroupIndex": 1
142
+ },
143
+ {
144
+ "name": "class",
145
+ "type": "Categorical",
146
+ "valueGroups": [
147
+ {
148
+ "cluster": "{less}",
149
+ "values": ["less"],
150
+ "valueFrequencies": [768],
151
+ "valueTypicalities": [1]
152
+ },
153
+ {
154
+ "cluster": "{more}",
155
+ "values": ["more"],
156
+ "valueFrequencies": [232],
157
+ "valueTypicalities": [1]
158
+ }
159
+ ],
160
+ "defaultGroupIndex": 1
161
+ }
162
+ ],
163
+ "dimensionHierarchies": [
164
+ {
165
+ "name": "occupation",
166
+ "type": "Categorical",
167
+ "clusters": [
168
+ {
169
+ "cluster": "{Prof-specialty, Exec-managerial, Tech-support, ...}",
170
+ "parentCluster": "A2",
171
+ "frequency": 482,
172
+ "interest": 1,
173
+ "hierarchicalLevel": 1,
174
+ "rank": 1,
175
+ "hierarchicalRank": 11,
176
+ "isLeaf": true
177
+ },
178
+ {
179
+ "cluster": "{Craft-repair, Transport-moving, Handlers-cleaners, ...}",
180
+ "parentCluster": "A6",
181
+ "frequency": 314,
182
+ "interest": 0.968624,
183
+ "hierarchicalLevel": 1,
184
+ "rank": 3,
185
+ "hierarchicalRank": 11,
186
+ "isLeaf": true
187
+ },
188
+ {
189
+ "cluster": "{Other-service, Adm-clerical, Priv-house-serv}",
190
+ "parentCluster": "A6",
191
+ "frequency": 204,
192
+ "interest": 0.781516,
193
+ "hierarchicalLevel": 1,
194
+ "rank": 5,
195
+ "hierarchicalRank": 11,
196
+ "isLeaf": true
197
+ },
198
+ {
199
+ "cluster": "A2",
200
+ "parentCluster": "",
201
+ "frequency": 1000,
202
+ "interest": 0.945577,
203
+ "hierarchicalLevel": -0.0276241,
204
+ "rank": 2,
205
+ "hierarchicalRank": 6,
206
+ "isLeaf": false
207
+ },
208
+ {
209
+ "cluster": "A6",
210
+ "parentCluster": "A2",
211
+ "frequency": 518,
212
+ "interest": 0.894937,
213
+ "hierarchicalLevel": 0.881083,
214
+ "rank": 4,
215
+ "hierarchicalRank": 10,
216
+ "isLeaf": false
217
+ }
218
+ ]
219
+ },
220
+ {
221
+ "name": "education_num",
222
+ "type": "Numerical",
223
+ "clusters": [
224
+ {
225
+ "cluster": "]-inf;11.5]",
226
+ "parentCluster": "]-inf;+inf[",
227
+ "frequency": 721,
228
+ "interest": 1,
229
+ "hierarchicalLevel": 1,
230
+ "rank": 1,
231
+ "hierarchicalRank": 11,
232
+ "isLeaf": true
233
+ },
234
+ {
235
+ "cluster": "]11.5;+inf[",
236
+ "parentCluster": "]-inf;+inf[",
237
+ "frequency": 279,
238
+ "interest": 1,
239
+ "hierarchicalLevel": 1,
240
+ "rank": 3,
241
+ "hierarchicalRank": 11,
242
+ "isLeaf": true
243
+ },
244
+ {
245
+ "cluster": "]-inf;+inf[",
246
+ "parentCluster": "",
247
+ "frequency": 1000,
248
+ "interest": 1,
249
+ "hierarchicalLevel": 0,
250
+ "rank": 2,
251
+ "hierarchicalRank": 5,
252
+ "isLeaf": false
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "name": "marital_status",
258
+ "type": "Categorical",
259
+ "clusters": [
260
+ {
261
+ "cluster": "{Never-married, Divorced, Widowed, ...}",
262
+ "parentCluster": "C4",
263
+ "frequency": 557,
264
+ "interest": 1,
265
+ "hierarchicalLevel": 1,
266
+ "rank": 1,
267
+ "hierarchicalRank": 11,
268
+ "isLeaf": true
269
+ },
270
+ {
271
+ "cluster": "{Married-civ-spouse}",
272
+ "parentCluster": "C4",
273
+ "frequency": 443,
274
+ "interest": 1,
275
+ "hierarchicalLevel": 1,
276
+ "rank": 3,
277
+ "hierarchicalRank": 11,
278
+ "isLeaf": true
279
+ },
280
+ {
281
+ "cluster": "C4",
282
+ "parentCluster": "",
283
+ "frequency": 1000,
284
+ "interest": 1,
285
+ "hierarchicalLevel": 0.453332,
286
+ "rank": 2,
287
+ "hierarchicalRank": 8,
288
+ "isLeaf": false
289
+ }
290
+ ]
291
+ },
292
+ {
293
+ "name": "sex",
294
+ "type": "Categorical",
295
+ "clusters": [
296
+ {
297
+ "cluster": "{Male}",
298
+ "parentCluster": "D5",
299
+ "frequency": 671,
300
+ "interest": 1,
301
+ "hierarchicalLevel": 1,
302
+ "rank": 1,
303
+ "hierarchicalRank": 11,
304
+ "isLeaf": true
305
+ },
306
+ {
307
+ "cluster": "{Female}",
308
+ "parentCluster": "D5",
309
+ "frequency": 329,
310
+ "interest": 1,
311
+ "hierarchicalLevel": 1,
312
+ "rank": 3,
313
+ "hierarchicalRank": 11,
314
+ "isLeaf": true
315
+ },
316
+ {
317
+ "cluster": "D5",
318
+ "parentCluster": "",
319
+ "frequency": 1000,
320
+ "interest": 1,
321
+ "hierarchicalLevel": 0.733975,
322
+ "rank": 2,
323
+ "hierarchicalRank": 9,
324
+ "isLeaf": false
325
+ }
326
+ ]
327
+ },
328
+ {
329
+ "name": "class",
330
+ "type": "Categorical",
331
+ "clusters": [
332
+ {
333
+ "cluster": "{less}",
334
+ "parentCluster": "E3",
335
+ "frequency": 768,
336
+ "interest": 1,
337
+ "hierarchicalLevel": 1,
338
+ "rank": 1,
339
+ "hierarchicalRank": 11,
340
+ "isLeaf": true
341
+ },
342
+ {
343
+ "cluster": "{more}",
344
+ "parentCluster": "E3",
345
+ "frequency": 232,
346
+ "interest": 1,
347
+ "hierarchicalLevel": 1,
348
+ "rank": 3,
349
+ "hierarchicalRank": 11,
350
+ "isLeaf": true
351
+ },
352
+ {
353
+ "cluster": "E3",
354
+ "parentCluster": "",
355
+ "frequency": 1000,
356
+ "interest": 1,
357
+ "hierarchicalLevel": 0.289554,
358
+ "rank": 2,
359
+ "hierarchicalRank": 7,
360
+ "isLeaf": false
361
+ }
362
+ ]
363
+ }
364
+ ],
365
+ "cellPartIndexes": [
366
+ [1,0,0,0,0],
367
+ [1,0,1,0,0],
368
+ [2,0,0,1,0],
369
+ [0,1,1,0,1],
370
+ [0,0,0,1,0],
371
+ [0,0,0,0,0],
372
+ [0,0,1,0,0],
373
+ [0,1,0,1,0],
374
+ [0,1,0,0,0],
375
+ [0,0,1,0,1],
376
+ [1,0,1,0,1],
377
+ [2,0,0,0,0],
378
+ [1,0,0,1,0],
379
+ [0,1,1,0,0],
380
+ [2,0,1,0,0],
381
+ [0,1,0,1,1],
382
+ [2,0,1,1,0],
383
+ [0,1,0,0,1],
384
+ [1,1,0,0,0],
385
+ [0,0,1,1,0],
386
+ [0,1,1,1,1],
387
+ [1,1,1,0,0],
388
+ [1,0,1,1,0],
389
+ [2,0,1,1,1],
390
+ [2,0,1,0,1],
391
+ [2,1,0,1,0],
392
+ [0,0,1,1,1],
393
+ [0,1,1,1,0],
394
+ [2,1,1,0,1],
395
+ [1,0,0,0,1],
396
+ [2,1,0,0,0],
397
+ [0,0,0,0,1],
398
+ [1,0,1,1,1],
399
+ [1,0,0,1,1],
400
+ [1,1,1,0,1],
401
+ [1,1,0,1,0],
402
+ [2,1,1,1,1],
403
+ [2,1,1,0,0],
404
+ [2,1,1,1,0],
405
+ [0,0,0,1,1]
406
+ ],
407
+ "cellFrequencies": [110,102,97,83,72,64,50,45,43,38,37,37,30,26,25,14,13,13,10,10,8,7,6,6,6,6,6,6,5,4,4,3,2,2,2,2,2,2,1,1]
408
+ }
409
+ }
package/frame.html ADDED
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Khiops visualization</title>
7
+ <style>
8
+ body, html {
9
+ margin: 0;
10
+ padding: 0;
11
+ height: 100%;
12
+ width: 100%;
13
+ }
14
+ </style>
15
+ </head>
16
+ <body>
17
+ <script src="./khiops-webcomponents.bundle.js"></script>
18
+ <script>
19
+ const visuElementType = "khiops-visualization";
20
+ const covisuElementType = "khiops-covisualization";
21
+ const eventName = "valueChanged";
22
+ let visuType;
23
+
24
+ document.addEventListener("DOMContentLoaded", function () {
25
+ window.addEventListener("message", (e) => {
26
+ console.log(e.data.tool);
27
+ if (e.origin === window.location.origin) {
28
+ console.info('get message');
29
+ if (e.data.tool === "Khiops") {
30
+ visuType = visuElementType;
31
+ } else if (e.data.tool === "Khiops Coclustering") {
32
+ visuType = covisuElementType;
33
+ }
34
+ if (visuType) {
35
+ const visu = document.createElement(visuType);
36
+ document.body.appendChild(visu);
37
+ visu.setConfig({
38
+ appSource : 'WEB',
39
+ changeDetector : true
40
+ });
41
+ visu.addEventListener(eventName, resendDataEvent, false)
42
+ visu.clean();
43
+ visu.setDatas(e.data);
44
+ }
45
+ }
46
+ },
47
+ false);
48
+ });
49
+
50
+ function resendDataEvent(e) {
51
+ document.dispatchEvent(new CustomEvent(eventName, {
52
+ detail: e.detail
53
+ }))
54
+ }
55
+ </script>
56
+ </body>
57
+ </html>
package/iframe.html ADDED
@@ -0,0 +1,36 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Document</title>
7
+ <style>
8
+ html, body {
9
+ margin: 0;
10
+ padding: 0;
11
+ overflow: hidden;
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <iframe src="./frame.html" frameborder="0" style="height: 100vh; width: 100vw;" id="visu-frame"></iframe>
17
+ <script>
18
+ document.addEventListener("DOMContentLoaded", () => {
19
+ const visu = document.getElementById('visu-frame');
20
+
21
+ const file = "./assets/mock/AdultAllReports.json"
22
+ visu.onload = () => {
23
+ fetch(file).then((response) => {
24
+ response.json().then((data) => {
25
+ if (visu && visu.contentWindow) {
26
+ visu.contentWindow.postMessage(data);
27
+ }
28
+ })
29
+ });
30
+ console.log(visu.contentWindow.document);
31
+ visu.contentWindow.document.addEventListener("valueChanged", (e) => console.log(e));
32
+ };
33
+ });
34
+ </script>
35
+ </body>
36
+ </html>
package/index.html CHANGED
@@ -1,4 +1,6 @@
1
- <!DOCTYPE html><html lang="en"><head>
1
+ <!doctype html>
2
+ <html lang="en" data-critters-container>
3
+ <head>
2
4
  <meta charset="utf-8">
3
5
  <title>KhiopsWebcomponent</title>
4
6
  <base href="/">
@@ -40,6 +42,5 @@
40
42
  }
41
43
  };
42
44
  </script>
43
- <script src="polyfills.js" type="module"></script><script src="main.js" type="module"></script>
44
-
45
- </body></html>
45
+ <script src="polyfills.js" type="module"></script><script src="main.js" type="module"></script></body>
46
+ </html>