@avs/go 0.13.71764 → 0.13.71891
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/demo/data/scene.json +1 -0
- package/demo/img/avs.png +0 -0
- package/demo/jsonView.html +15 -10
- package/dist/avs-go.min.js +1 -1
- package/dist/avs-go.min.js.LICENSE.txt +1 -1
- package/package.json +2 -2
- package/src/avs-go-dataviz.js +67 -37
- package/src/constants.js +1 -1
- package/demo/data/hydrogen.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avs/go",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.71891",
|
|
4
4
|
"description": "AVS Go",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polymer",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@polymer/iron-resizable-behavior": "^3.0.1",
|
|
32
32
|
"@polymer/polymer": "^3.5.2",
|
|
33
|
-
"three": "0.
|
|
33
|
+
"three": "0.183.2"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/avs-go-dataviz.js
CHANGED
|
@@ -610,7 +610,7 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
610
610
|
* Assemble the model from our properties to send to the server.
|
|
611
611
|
*/
|
|
612
612
|
_assembleModel(fullReset) {
|
|
613
|
-
if (this.sceneName
|
|
613
|
+
if (!this.sceneName) {
|
|
614
614
|
this._logError( JSON.stringify( {"GoType":1, "error":"\'scene-name\' property must be set to the name of the scene registered in the library map on the server."} ) );
|
|
615
615
|
return undefined;
|
|
616
616
|
}
|
|
@@ -619,29 +619,29 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
619
619
|
|
|
620
620
|
// Scene Properties
|
|
621
621
|
var sceneProperties = {name:this.sceneName};
|
|
622
|
-
if (this.sceneUserProperties
|
|
622
|
+
if (this.sceneUserProperties) {
|
|
623
623
|
sceneProperties.userProperties = this.sceneUserProperties;
|
|
624
624
|
}
|
|
625
625
|
model.sceneProperties = sceneProperties;
|
|
626
626
|
|
|
627
627
|
// Renderer Properties
|
|
628
628
|
var rendererProperties = {width:this.width, height:this.height, name:this.rendererName, type:this.renderer};
|
|
629
|
-
if (this.rendererUserProperties
|
|
629
|
+
if (this.rendererUserProperties) {
|
|
630
630
|
rendererProperties.userProperties = this.rendererUserProperties;
|
|
631
631
|
}
|
|
632
632
|
model.rendererProperties = rendererProperties;
|
|
633
633
|
|
|
634
634
|
// Transform Properties
|
|
635
|
-
if (this.transformInteractor
|
|
635
|
+
if (this.transformInteractor) {
|
|
636
636
|
// Update the local transform matrix from the transform interactor, we may have transformed since the last request
|
|
637
637
|
this.transformMatrix = this.transformInteractor.object.matrix.elements.slice();
|
|
638
638
|
this.transformClientOnly = this.transformInteractor.clientOnly;
|
|
639
639
|
}
|
|
640
|
-
if (this.transformMatrix
|
|
640
|
+
if (this.transformMatrix && !this.transformClientOnly) {
|
|
641
641
|
rendererProperties.transformMatrix = this.transformMatrix;
|
|
642
642
|
}
|
|
643
|
-
if (fullReset
|
|
644
|
-
if (this.transformClientOnly && this.transformInteractor
|
|
643
|
+
if (fullReset) {
|
|
644
|
+
if (this.transformClientOnly && this.transformInteractor) {
|
|
645
645
|
this.transformInteractor.fullReset = fullReset;
|
|
646
646
|
}
|
|
647
647
|
else {
|
|
@@ -688,7 +688,6 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
688
688
|
"scenePointColor": "--avs-scene-point-color",
|
|
689
689
|
"sceneLineColor": "--avs-scene-line-color",
|
|
690
690
|
"sceneLineWidth": "--avs-scene-line-width",
|
|
691
|
-
"sceneLineOpacity": "--avs-scene-line-opacity",
|
|
692
691
|
"sceneTextColor": "--avs-scene-text-color",
|
|
693
692
|
"sceneTextRotation": "--avs-scene-text-rotation",
|
|
694
693
|
"sceneFontFamily": "--avs-scene-font-family",
|
|
@@ -716,7 +715,6 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
716
715
|
"chartLineColor": "--avs-chart-line-color",
|
|
717
716
|
"chartLineWidth": "--avs-chart-line-width",
|
|
718
717
|
"chartLinePattern": "--avs-chart-line-pattern",
|
|
719
|
-
"chartLineOpacity": "--avs-chart-line-opacity",
|
|
720
718
|
"chartTextColor": "--avs-chart-text-color",
|
|
721
719
|
"chartTextRotation": "--avs-chart-text-rotation",
|
|
722
720
|
"chartFontFamily": "--avs-chart-font-family",
|
|
@@ -733,7 +731,6 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
733
731
|
// Axis
|
|
734
732
|
"axisLineColor": "--avs-axis-line-color",
|
|
735
733
|
"axisLineWidth": "--avs-axis-line-width",
|
|
736
|
-
"axisLineOpacity": "--avs-axis-line-opacity",
|
|
737
734
|
"axisTextColor": "--avs-axis-text-color",
|
|
738
735
|
"axisTextRotation": "--avs-axis-text-rotation",
|
|
739
736
|
"axisFontFamily": "--avs-axis-font-family",
|
|
@@ -743,13 +740,27 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
743
740
|
// Axis axle
|
|
744
741
|
"axisAxleColor": "--avs-axis-axle-color",
|
|
745
742
|
"axisAxleWidth": "--avs-axis-axle-width",
|
|
746
|
-
// Axis tick
|
|
747
|
-
"
|
|
748
|
-
"
|
|
749
|
-
// Axis tick
|
|
750
|
-
"
|
|
751
|
-
"
|
|
752
|
-
"
|
|
743
|
+
// Axis major tick marks
|
|
744
|
+
"axisMajorTickMarkColor": "--avs-axis-major-tick-mark-color",
|
|
745
|
+
"axisMajorTickMarkWidth": "--avs-axis-major-tick-mark-width",
|
|
746
|
+
// Axis major tick lines
|
|
747
|
+
"axisMajorTickLineColor": "--avs-axis-major-tick-line-color",
|
|
748
|
+
"axisMajorTickLineWidth": "--avs-axis-major-tick-line-width",
|
|
749
|
+
"axisMajorTickLineStyle": "--avs-axis-major-tick-line-style",
|
|
750
|
+
// Axis major unlabeled tick marks
|
|
751
|
+
"axisMajorUnlabeledTickMarkColor": "--avs-axis-major-unlabeled-tick-mark-color",
|
|
752
|
+
"axisMajorUnlabeledTickMarkWidth": "--avs-axis-major-unlabeled-tick-mark-width",
|
|
753
|
+
// Axis major unlabeled tick lines
|
|
754
|
+
"axisMajorUnlabeledTickLineColor": "--avs-axis-major-unlabeled-tick-line-color",
|
|
755
|
+
"axisMajorUnlabeledTickLineWidth": "--avs-axis-major-unlabeled-tick-line-width",
|
|
756
|
+
"axisMajorUnlabeledTickLineStyle": "--avs-axis-major-unlabeled-tick-line-style",
|
|
757
|
+
// Axis minor tick marks
|
|
758
|
+
"axisMinorTickMarkColor": "--avs-axis-minor-tick-mark-color",
|
|
759
|
+
"axisMinorTickMarkWidth": "--avs-axis-minor-tick-mark-width",
|
|
760
|
+
// Axis minor tick lines
|
|
761
|
+
"axisMinorTickLineColor": "--avs-axis-minor-tick-line-color",
|
|
762
|
+
"axisMinorTickLineWidth": "--avs-axis-minor-tick-line-width",
|
|
763
|
+
"axisMinorTickLineStyle": "--avs-axis-minor-tick-line-style",
|
|
753
764
|
// Axis title
|
|
754
765
|
"axisTitleTextColor": "--avs-axis-title-text-color",
|
|
755
766
|
"axisTitleTextRotation": "--avs-axis-title-text-rotation",
|
|
@@ -779,18 +790,14 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
779
790
|
"legendFontStyle": "--avs-legend-font-style",
|
|
780
791
|
"legendFontWeight": "--avs-legend-font-weight",
|
|
781
792
|
"legendFontSize": "--avs-legend-font-size",
|
|
793
|
+
"legendPointColor": "--avs-legend-point-color",
|
|
782
794
|
// Legend title
|
|
783
795
|
"legendTitleTextColor": "--avs-legend-title-text-color",
|
|
784
796
|
"legendTitleTextRotation": "--avs-legend-title-text-rotation",
|
|
785
797
|
"legendTitleFontFamily": "--avs-legend-title-font-family",
|
|
786
798
|
"legendTitleFontStyle": "--avs-legend-title-font-style",
|
|
787
799
|
"legendTitleFontWeight": "--avs-legend-title-font-weight",
|
|
788
|
-
"legendTitleFontSize": "--avs-legend-title-font-size"
|
|
789
|
-
// Defaults
|
|
790
|
-
"defaultPointSize": "--avs-default-point-size",
|
|
791
|
-
"defaultGlyphSize": "--avs-default-glyph-size",
|
|
792
|
-
"minGlyphSize": "--avs-min-glyph-size",
|
|
793
|
-
"maxGlyphSize": "--avs-max-glyph-size"
|
|
800
|
+
"legendTitleFontSize": "--avs-legend-title-font-size"
|
|
794
801
|
} );
|
|
795
802
|
|
|
796
803
|
this._addDataSourceProperties(model);
|
|
@@ -928,9 +935,9 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
928
935
|
this._httpRequest(this.url, this._handleHttpResponse.bind(this), undefined, this._handleHttpError.bind(this));
|
|
929
936
|
}
|
|
930
937
|
else {
|
|
931
|
-
|
|
932
|
-
if (model
|
|
933
|
-
this._httpRequest(this.url, this._handleHttpResponse.bind(this), undefined, this._handleHttpError.bind(this), model);
|
|
938
|
+
this.model = this._assembleModel(fullReset);
|
|
939
|
+
if (this.model) {
|
|
940
|
+
this._httpRequest(this.url, this._handleHttpResponse.bind(this), undefined, this._handleHttpError.bind(this), this.model);
|
|
934
941
|
}
|
|
935
942
|
}
|
|
936
943
|
}
|
|
@@ -1044,14 +1051,27 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
1044
1051
|
this.sceneImageMap.innerHTML = "";
|
|
1045
1052
|
this.imageMapData = undefined;
|
|
1046
1053
|
}
|
|
1047
|
-
|
|
1054
|
+
|
|
1055
|
+
if (!this.urlLoadJsonFile) {
|
|
1056
|
+
this._dispatchSceneData(json);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1048
1059
|
this._handleLoadComplete();
|
|
1049
1060
|
}
|
|
1050
1061
|
else if (json.svg) {
|
|
1051
1062
|
this.svgDiv.innerHTML = decodeURIComponent(json.svg.replace(/\+/g, '%20'));
|
|
1063
|
+
|
|
1064
|
+
if (!this.urlLoadJsonFile) {
|
|
1065
|
+
this._dispatchSceneData(json);
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1052
1068
|
this._handleLoadComplete();
|
|
1053
1069
|
}
|
|
1054
1070
|
else if (json.threejs) {
|
|
1071
|
+
if (!this.urlLoadJsonFile) {
|
|
1072
|
+
this._dispatchSceneData(json);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1055
1075
|
if (json.threejs.chunkId) {
|
|
1056
1076
|
this.threeViewer.loadGeometryAsEvents(json.threejs, this._handleLoadComplete.bind(this));
|
|
1057
1077
|
|
|
@@ -1065,11 +1085,8 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
1065
1085
|
}
|
|
1066
1086
|
else {
|
|
1067
1087
|
// Get the next chunk from the server
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
model.rendererProperties.streamProperties.chunkId = json.threejs.chunkId;
|
|
1071
|
-
this._httpRequest(this.url, this._handleHttpResponse.bind(this), undefined, this._handleHttpError.bind(this), model);
|
|
1072
|
-
}
|
|
1088
|
+
this.model.rendererProperties.streamProperties.chunkId = json.threejs.chunkId;
|
|
1089
|
+
this._httpRequest(this.url, this._handleHttpResponse.bind(this), undefined, this._handleHttpError.bind(this), this.model);
|
|
1073
1090
|
}
|
|
1074
1091
|
}
|
|
1075
1092
|
}
|
|
@@ -1123,6 +1140,19 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
1123
1140
|
this.dispatchEvent(new CustomEvent('avs-load-complete'));
|
|
1124
1141
|
}
|
|
1125
1142
|
|
|
1143
|
+
/**
|
|
1144
|
+
*
|
|
1145
|
+
*/
|
|
1146
|
+
_dispatchSceneData(data) {
|
|
1147
|
+
const event = { detail: data };
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* Scene data from server.
|
|
1151
|
+
* @event avs-scene-data
|
|
1152
|
+
*/
|
|
1153
|
+
this.dispatchEvent(new CustomEvent('avs-scene-data', event));
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1126
1156
|
/**
|
|
1127
1157
|
* @param e
|
|
1128
1158
|
*/
|
|
@@ -1404,14 +1434,14 @@ export class AvsGoDataViz extends AvsDataSourceMixin(AvsStreamMixin(AvsHttpMixin
|
|
|
1404
1434
|
// Server side pick processing
|
|
1405
1435
|
|
|
1406
1436
|
this.showSpinner();
|
|
1407
|
-
if (this.url
|
|
1437
|
+
if (this.url) {
|
|
1408
1438
|
this.startSpinner();
|
|
1409
1439
|
|
|
1410
1440
|
// Use avs-http-mixin to send the model to the server
|
|
1411
|
-
|
|
1412
|
-
if (model
|
|
1413
|
-
model.rendererProperties.pickProperties = pickProperties;
|
|
1414
|
-
this._httpRequest(this.url, this._handleHttpResponse.bind(this), undefined, this._handleHttpError.bind(this), model);
|
|
1441
|
+
this.model = this._assembleModel();
|
|
1442
|
+
if (this.model) {
|
|
1443
|
+
this.model.rendererProperties.pickProperties = pickProperties;
|
|
1444
|
+
this._httpRequest(this.url, this._handleHttpResponse.bind(this), undefined, this._handleHttpError.bind(this), this.model);
|
|
1415
1445
|
}
|
|
1416
1446
|
}
|
|
1417
1447
|
}
|
package/src/constants.js
CHANGED