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.
- package/README.md +86 -0
- package/css/colors.css +124 -0
- package/css/typography.css +44 -0
- package/css/widget.css +87 -0
- package/dist/index.js +76 -0
- package/lib/components/accordion/Accordion.js +51 -0
- package/lib/components/accordion/index.js +18 -0
- package/lib/extension.js +31 -0
- package/lib/feature/feature-details/FeatureCorrelatedFeaturesTable.js +22 -0
- package/lib/feature/feature-details/FeatureDistributionChart.js +218 -0
- package/lib/feature/feature-details/FeatureStatisticsTable.js +44 -0
- package/lib/feature/feature-details/index.js +20 -0
- package/lib/feature/feature-explanation/FeatureExplanation.js +52 -0
- package/lib/feature/feature-explanation/components/ColoredExplanationBlock.js +30 -0
- package/lib/feature/feature-explanation/components/ColumnExplanationBlock.js +11 -0
- package/lib/feature/feature-explanation/components/DataSlotExplanationBlock.js +11 -0
- package/lib/feature/feature-explanation/components/PetExplanationBlock.js +11 -0
- package/lib/feature/feature-explanation/components/TextExplanationBlock.js +12 -0
- package/lib/feature/feature-explanation/components/TextWithDataSlotContextExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/TopicExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/UnknownExplanationBlock.js +10 -0
- package/lib/feature/feature-likes/feature-likes.js +44 -0
- package/lib/feature/feature-likes/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptions-tree/components/column-tree-item.js +16 -0
- package/lib/feature-descriptor/domains-descriptions-tree/components/descriptions-tree-item.js +51 -0
- package/lib/feature-descriptor/domains-descriptions-tree/components/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptions-tree/components/tree-item-label.js +54 -0
- package/lib/feature-descriptor/domains-descriptions-tree/components/type-tree-item.js +19 -0
- package/lib/feature-descriptor/domains-descriptions-tree/config/index.js +11 -0
- package/lib/feature-descriptor/domains-descriptions-tree/context/domains-descriptions-selection-context.js +54 -0
- package/lib/feature-descriptor/domains-descriptions-tree/context/domains-descriptions-tree-config-context.js +42 -0
- package/lib/feature-descriptor/domains-descriptions-tree/context/domains-descriptions-tree-item-selection-context.js +56 -0
- package/lib/feature-descriptor/domains-descriptions-tree/context/index.js +20 -0
- package/lib/feature-descriptor/domains-descriptions-tree/domains-descriptions-tree.js +44 -0
- package/lib/feature-descriptor/domains-descriptions-tree/index.js +21 -0
- package/lib/feature-descriptor/domains-descriptions-tree/models/domains-descriptions-tree.model.js +37 -0
- package/lib/feature-descriptor/domains-descriptions-tree/models/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptions-tree/utils/create-domain-predicate.js +16 -0
- package/lib/feature-descriptor/domains-descriptions-tree/utils/filter-domains-descriptions-tree.js +23 -0
- package/lib/feature-descriptor/domains-descriptions-tree/utils/index.js +19 -0
- package/lib/feature-descriptor/feature-exploration-path/exploration-path-header.js +38 -0
- package/lib/feature-descriptor/feature-exploration-path/exploration-path-join-list.js +28 -0
- package/lib/feature-descriptor/feature-exploration-path/index.js +19 -0
- package/lib/index.js +21 -0
- package/lib/models/column/column.js +3 -0
- package/lib/models/column/index.js +18 -0
- package/lib/models/feature/feature-histogram.js +20 -0
- package/lib/models/feature/feature-metric.js +16 -0
- package/lib/models/feature/feature.js +3 -0
- package/lib/models/feature/index.js +20 -0
- package/lib/models/feature-descriptor-domain/fd-domains-description.js +15 -0
- package/lib/models/feature-descriptor-domain/fd-join-description.js +3 -0
- package/lib/models/feature-descriptor-domain/index.js +19 -0
- package/lib/models/feature-explanation/feature-explanation.model.js +30 -0
- package/lib/models/feature-explanation/index.js +18 -0
- package/lib/models/feature-leaderboard/feature-leaderboard.js +3 -0
- package/lib/models/feature-leaderboard/index.js +18 -0
- package/lib/models/feature-space/exploration-path.js +3 -0
- package/lib/models/feature-space/feature-space.js +3 -0
- package/lib/models/feature-space/grouped-domains-descriptions.js +3 -0
- package/lib/models/feature-space/index.js +20 -0
- package/lib/plugin.js +54 -0
- package/lib/utils/asserations.js +10 -0
- package/lib/utils/index.js +20 -0
- package/lib/utils/localize.js +18 -0
- package/lib/utils/model-transform-hook.js +21 -0
- package/lib/utils/object/extract-property.js +11 -0
- package/lib/utils/object/index.js +19 -0
- package/lib/utils/object/is-set.js +12 -0
- package/lib/utils/set.js +14 -0
- package/lib/utils/transducer.js +16 -0
- package/lib/utils/widget-model/index.js +19 -0
- package/lib/utils/widget-model/widget-model-context.js +42 -0
- package/lib/utils/widget-model/widget-model.js +30 -0
- package/lib/utils/widget-theme/index.js +18 -0
- package/lib/utils/widget-theme/widget-theme.js +99 -0
- package/lib/version.js +21 -0
- package/lib/widgets/FeatureLeaderboardWidget.js +61 -0
- package/lib/widgets/FeatureSpaceWidget.js +64 -0
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardOverview.js +25 -0
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardView.js +45 -0
- package/lib/widgets/feature-leaderboard/components/leaderboard-feature-likes.js +50 -0
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntry.js +19 -0
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryDetails.js +23 -0
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryRow.js +23 -0
- package/lib/widgets/feature-leaderboard/leaderboard-overview/overview-slider.js +62 -0
- package/lib/widgets/feature-space/FeatureDomainsDescriptions.js +74 -0
- package/lib/widgets/feature-space/FeatureExplorationPaths.js +16 -0
- package/lib/widgets/feature-space/FeatureSpaceView.js +52 -0
- package/lib/widgets/index.js +21 -0
- package/package.json +119 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) dotdata
|
|
3
|
+
// Distributed under the terms of the Modified BSD License.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
__exportStar(require("./version"), exports);
|
|
20
|
+
__exportStar(require("./widgets"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./column"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscreteHistogram = exports.ContinuousHistogram = void 0;
|
|
4
|
+
var ContinuousHistogram;
|
|
5
|
+
(function (ContinuousHistogram) {
|
|
6
|
+
function isTypeOf(histogram) {
|
|
7
|
+
const bin = histogram.bins[0];
|
|
8
|
+
return bin && 'l' in bin && 'u' in bin;
|
|
9
|
+
}
|
|
10
|
+
ContinuousHistogram.isTypeOf = isTypeOf;
|
|
11
|
+
})(ContinuousHistogram = exports.ContinuousHistogram || (exports.ContinuousHistogram = {}));
|
|
12
|
+
var DiscreteHistogram;
|
|
13
|
+
(function (DiscreteHistogram) {
|
|
14
|
+
function isTypeOf(histogram) {
|
|
15
|
+
const bin = histogram.bins[0];
|
|
16
|
+
return bin && 'label' in bin;
|
|
17
|
+
}
|
|
18
|
+
DiscreteHistogram.isTypeOf = isTypeOf;
|
|
19
|
+
})(DiscreteHistogram = exports.DiscreteHistogram || (exports.DiscreteHistogram = {}));
|
|
20
|
+
//# sourceMappingURL=feature-histogram.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeatureMetric = void 0;
|
|
4
|
+
var FeatureMetric;
|
|
5
|
+
(function (FeatureMetric) {
|
|
6
|
+
FeatureMetric["Min"] = "Min";
|
|
7
|
+
FeatureMetric["Max"] = "Max";
|
|
8
|
+
FeatureMetric["Mean"] = "Mean";
|
|
9
|
+
FeatureMetric["Stddev"] = "Stddev";
|
|
10
|
+
FeatureMetric["Count"] = "Count";
|
|
11
|
+
FeatureMetric["NullRatio"] = "Null ratio";
|
|
12
|
+
FeatureMetric["ZerosRatio"] = "Zeros ratio";
|
|
13
|
+
FeatureMetric["Correlation"] = "Correlation";
|
|
14
|
+
FeatureMetric["FeatureAUC"] = "Feature AUC";
|
|
15
|
+
})(FeatureMetric = exports.FeatureMetric || (exports.FeatureMetric = {}));
|
|
16
|
+
//# sourceMappingURL=feature-metric.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./feature"), exports);
|
|
18
|
+
__exportStar(require("./feature-histogram"), exports);
|
|
19
|
+
__exportStar(require("./feature-metric"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DomainsDescriptionId = void 0;
|
|
4
|
+
var DomainsDescriptionId;
|
|
5
|
+
(function (DomainsDescriptionId) {
|
|
6
|
+
function toString(id) {
|
|
7
|
+
return `${id.joinId}_${id.domainIdx}_${id.opIdx}`;
|
|
8
|
+
}
|
|
9
|
+
DomainsDescriptionId.toString = toString;
|
|
10
|
+
function listToMap(list) {
|
|
11
|
+
return new Map(list.map(el => [DomainsDescriptionId.toString(el), el]));
|
|
12
|
+
}
|
|
13
|
+
DomainsDescriptionId.listToMap = listToMap;
|
|
14
|
+
})(DomainsDescriptionId = exports.DomainsDescriptionId || (exports.DomainsDescriptionId = {}));
|
|
15
|
+
//# sourceMappingURL=fd-domains-description.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./fd-join-description"), exports);
|
|
18
|
+
__exportStar(require("./fd-domains-description"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeatureExplanationBlock = void 0;
|
|
4
|
+
var FeatureExplanationBlock;
|
|
5
|
+
(function (FeatureExplanationBlock) {
|
|
6
|
+
let Type;
|
|
7
|
+
(function (Type) {
|
|
8
|
+
Type["PredictionExecutionTime"] = "PetToken";
|
|
9
|
+
Type["DataSlot"] = "DataSlotToken";
|
|
10
|
+
Type["Text"] = "TextToken";
|
|
11
|
+
Type["Column"] = "ColumnToken";
|
|
12
|
+
Type["TargetColumn"] = "TargetColumnToken";
|
|
13
|
+
Type["Topic"] = "TopicToken";
|
|
14
|
+
Type["TextWithDataSlotContext"] = "textWithDataSlotContext";
|
|
15
|
+
Type["Map"] = "MapToken";
|
|
16
|
+
Type["Reduce"] = "ReduceToken";
|
|
17
|
+
Type["Filter"] = "FilterToken";
|
|
18
|
+
Type["TimeDiff"] = "TimeDiffToken";
|
|
19
|
+
Type["PeriodicTimeDiff"] = "PeriodicTimeDiffToken";
|
|
20
|
+
Type["DistanceMap"] = "DistanceMapToken";
|
|
21
|
+
})(Type = FeatureExplanationBlock.Type || (FeatureExplanationBlock.Type = {}));
|
|
22
|
+
FeatureExplanationBlock.isOperatorExplanationBlock = (block) => 'tokens' in block;
|
|
23
|
+
FeatureExplanationBlock.isTextExplanationBlock = (block) => Type.Text === block.type;
|
|
24
|
+
FeatureExplanationBlock.isColumnExplanationBlock = (block) => [Type.Column, Type.TargetColumn].includes(block.type);
|
|
25
|
+
FeatureExplanationBlock.isDataSlotExplanationBlock = (block) => Type.DataSlot === block.type;
|
|
26
|
+
FeatureExplanationBlock.isPetExplanationBlock = (block) => Type.PredictionExecutionTime === block.type;
|
|
27
|
+
FeatureExplanationBlock.isTopicExplanationBlock = (block) => Type.Topic === block.type;
|
|
28
|
+
FeatureExplanationBlock.isTextWithDataSlotContextExplanationBlock = (block) => Type.TextWithDataSlotContext === block.type;
|
|
29
|
+
})(FeatureExplanationBlock = exports.FeatureExplanationBlock || (exports.FeatureExplanationBlock = {}));
|
|
30
|
+
//# sourceMappingURL=feature-explanation.model.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./feature-explanation.model"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./feature-leaderboard"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./feature-space"), exports);
|
|
18
|
+
__exportStar(require("./exploration-path"), exports);
|
|
19
|
+
__exportStar(require("./grouped-domains-descriptions"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
package/lib/plugin.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) dotdata
|
|
3
|
+
// Distributed under the terms of the Modified BSD License.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
const base_1 = require("@jupyter-widgets/base");
|
|
29
|
+
const widgetExports = __importStar(require("./widgets"));
|
|
30
|
+
const version_1 = require("./version");
|
|
31
|
+
const EXTENSION_ID = 'dotdata_widgets:plugin';
|
|
32
|
+
/**
|
|
33
|
+
* The example plugin.
|
|
34
|
+
*/
|
|
35
|
+
const examplePlugin = {
|
|
36
|
+
id: EXTENSION_ID,
|
|
37
|
+
requires: [base_1.IJupyterWidgetRegistry],
|
|
38
|
+
activate: activateWidgetExtension,
|
|
39
|
+
autoStart: true,
|
|
40
|
+
};
|
|
41
|
+
// the "as unknown as ..." typecast above is solely to support JupyterLab 1
|
|
42
|
+
// and 2 in the same codebase and should be removed when we migrate to Lumino.
|
|
43
|
+
exports.default = examplePlugin;
|
|
44
|
+
/**
|
|
45
|
+
* Activate the widget extension.
|
|
46
|
+
*/
|
|
47
|
+
function activateWidgetExtension(app, registry) {
|
|
48
|
+
registry.registerWidget({
|
|
49
|
+
name: version_1.MODULE_NAME,
|
|
50
|
+
version: version_1.MODULE_VERSION,
|
|
51
|
+
exports: widgetExports,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertIsSet = void 0;
|
|
4
|
+
function assertIsSet(obj, message) {
|
|
5
|
+
if (obj === undefined || obj === null) {
|
|
6
|
+
throw new Error(message ?? `Expected ${obj} to be defined`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.assertIsSet = assertIsSet;
|
|
10
|
+
//# sourceMappingURL=asserations.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./asserations"), exports);
|
|
18
|
+
__exportStar(require("./object"), exports);
|
|
19
|
+
__exportStar(require("./localize"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Localize = void 0;
|
|
4
|
+
const object_1 = require("./object");
|
|
5
|
+
const numberDefaultFormatter = new Intl.NumberFormat(navigator.language, {
|
|
6
|
+
maximumFractionDigits: 3,
|
|
7
|
+
useGrouping: false,
|
|
8
|
+
});
|
|
9
|
+
var Localize;
|
|
10
|
+
(function (Localize) {
|
|
11
|
+
function formatNumber(value, unsetSymbol) {
|
|
12
|
+
return (0, object_1.isSet)(value)
|
|
13
|
+
? numberDefaultFormatter.format(value)
|
|
14
|
+
: unsetSymbol ?? '';
|
|
15
|
+
}
|
|
16
|
+
Localize.formatNumber = formatNumber;
|
|
17
|
+
})(Localize = exports.Localize || (exports.Localize = {}));
|
|
18
|
+
//# sourceMappingURL=localize.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useModelTransform = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function useModelTransform(model, setModel, transform, revTransform, defaultState) {
|
|
9
|
+
const [transformedModel, setTransformedModel] = react_1.default.useState(() => defaultState);
|
|
10
|
+
react_1.default.useEffect(() => {
|
|
11
|
+
setTransformedModel(transform(model));
|
|
12
|
+
}, [model]);
|
|
13
|
+
return [
|
|
14
|
+
transformedModel,
|
|
15
|
+
(s) => {
|
|
16
|
+
setModel(revTransform(s));
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
exports.useModelTransform = useModelTransform;
|
|
21
|
+
//# sourceMappingURL=model-transform-hook.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractProperty = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
5
|
+
function extractProperty(property) {
|
|
6
|
+
return function extractFrom(source) {
|
|
7
|
+
return source[property];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.extractProperty = extractProperty;
|
|
11
|
+
//# sourceMappingURL=extract-property.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./is-set"), exports);
|
|
18
|
+
__exportStar(require("./extract-property"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNotSet = exports.isSet = void 0;
|
|
4
|
+
function isSet(obj) {
|
|
5
|
+
return obj !== undefined && obj !== null;
|
|
6
|
+
}
|
|
7
|
+
exports.isSet = isSet;
|
|
8
|
+
function isNotSet(obj) {
|
|
9
|
+
return obj === undefined || obj === null;
|
|
10
|
+
}
|
|
11
|
+
exports.isNotSet = isNotSet;
|
|
12
|
+
//# sourceMappingURL=is-set.js.map
|
package/lib/utils/set.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toggleSetItem = void 0;
|
|
4
|
+
function toggleSetItem(collection, item) {
|
|
5
|
+
if (collection.has(item)) {
|
|
6
|
+
collection.delete(item);
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
collection.add(item);
|
|
10
|
+
}
|
|
11
|
+
return new Set(collection);
|
|
12
|
+
}
|
|
13
|
+
exports.toggleSetItem = toggleSetItem;
|
|
14
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filter = exports.map = exports.compose = void 0;
|
|
4
|
+
function compose(...fns) {
|
|
5
|
+
return (x) => fns.reduce((y, f) => f(y), x);
|
|
6
|
+
}
|
|
7
|
+
exports.compose = compose;
|
|
8
|
+
function map(transformFn) {
|
|
9
|
+
return (step) => (a, c) => step(a, transformFn(c));
|
|
10
|
+
}
|
|
11
|
+
exports.map = map;
|
|
12
|
+
function filter(predicate) {
|
|
13
|
+
return (step) => (a, c) => predicate(c) ? step(a, c) : a;
|
|
14
|
+
}
|
|
15
|
+
exports.filter = filter;
|
|
16
|
+
//# sourceMappingURL=transducer.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./widget-model-context"), exports);
|
|
18
|
+
__exportStar(require("./widget-model"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.WidgetModelContextProvider = exports.useWidgetModelContext = exports.WidgetModelContext = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
exports.WidgetModelContext = (0, react_1.createContext)(undefined);
|
|
29
|
+
function useWidgetModelContext() {
|
|
30
|
+
const context = (0, react_1.useContext)(exports.WidgetModelContext);
|
|
31
|
+
if (context === undefined) {
|
|
32
|
+
throw new Error('WidgetModelContext has to be used in proper context');
|
|
33
|
+
}
|
|
34
|
+
return context;
|
|
35
|
+
}
|
|
36
|
+
exports.useWidgetModelContext = useWidgetModelContext;
|
|
37
|
+
const WidgetModelContextProvider = (Component) => {
|
|
38
|
+
return (props) => (react_1.default.createElement(exports.WidgetModelContext.Provider, { value: props.model },
|
|
39
|
+
react_1.default.createElement(Component, { ...props })));
|
|
40
|
+
};
|
|
41
|
+
exports.WidgetModelContextProvider = WidgetModelContextProvider;
|
|
42
|
+
//# sourceMappingURL=widget-model-context.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useModelEvent = exports.useModelState = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const widget_model_context_1 = require("./widget-model-context");
|
|
6
|
+
function useModelState(name) {
|
|
7
|
+
const model = (0, widget_model_context_1.useWidgetModelContext)();
|
|
8
|
+
const stringName = String(name);
|
|
9
|
+
const [state, setState] = (0, react_1.useState)(() => model.get(stringName));
|
|
10
|
+
useModelEvent(`change:${stringName}`, model => {
|
|
11
|
+
setState(model.get(stringName));
|
|
12
|
+
}, [name]);
|
|
13
|
+
function updateModel(val, options) {
|
|
14
|
+
model.set(name, val, options);
|
|
15
|
+
model.save_changes();
|
|
16
|
+
}
|
|
17
|
+
return [state, updateModel];
|
|
18
|
+
}
|
|
19
|
+
exports.useModelState = useModelState;
|
|
20
|
+
function useModelEvent(event, callback, deps) {
|
|
21
|
+
const model = (0, widget_model_context_1.useWidgetModelContext)();
|
|
22
|
+
const dependencies = deps === undefined ? [model] : [...deps, model];
|
|
23
|
+
(0, react_1.useEffect)(() => {
|
|
24
|
+
const callbackWrapper = (e) => callback(model, e);
|
|
25
|
+
model.on(event, callbackWrapper);
|
|
26
|
+
return () => void model.unbind(event, callbackWrapper);
|
|
27
|
+
}, dependencies);
|
|
28
|
+
}
|
|
29
|
+
exports.useModelEvent = useModelEvent;
|
|
30
|
+
//# sourceMappingURL=widget-model.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./widget-theme"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|