1086 switchTo3D() {
1087 if (!this.threeD) {
1088 this.threeD = true;
1089 setButtonColor(this.__button3D, Colors.getDefaultLayerColor(Registry.currentLayer), activeText);1090 setButtonColor(this.__button2D, inactiveBackground, inactiveText);
1091 this.renderer.loadJSON(Registry.currentDevice.toJSON());
1092 let cameraCenter = this.view.getViewCenterInMillimeters();
1069 newCenterY = Registry.currentDevice.params.getValue("height");
1070 }
1071 HTMLUtils.setButtonColor(this.__button2D, Colors.getDefaultLayerColor(Registry.currentLayer), activeText);
1072 HTMLUtils.setButtonColor(this.__button3D, inactiveBackground, inactiveText);1073 Registry.viewManager.setCenter(new paper.Point(newCenterX, newCenterY));
1074 Registry.viewManager.setZoom(zoom);
1075 HTMLUtils.addClass(this.__renderBlock, "hidden-block");
1069 newCenterY = Registry.currentDevice.params.getValue("height");
1070 }
1071 HTMLUtils.setButtonColor(this.__button2D, Colors.getDefaultLayerColor(Registry.currentLayer), activeText);
1072 HTMLUtils.setButtonColor(this.__button3D, inactiveBackground, inactiveText);1073 Registry.viewManager.setCenter(new paper.Point(newCenterX, newCenterY));
1074 Registry.viewManager.setZoom(zoom);
1075 HTMLUtils.addClass(this.__renderBlock, "hidden-block");
1068 } else if (newCenterY > Registry.currentDevice.params.getValue("height")) {
1069 newCenterY = Registry.currentDevice.params.getValue("height");
1070 }
1071 HTMLUtils.setButtonColor(this.__button2D, Colors.getDefaultLayerColor(Registry.currentLayer), activeText);1072 HTMLUtils.setButtonColor(this.__button3D, inactiveBackground, inactiveText);
1073 Registry.viewManager.setCenter(new paper.Point(newCenterX, newCenterY));
1074 Registry.viewManager.setZoom(zoom);
1087 if (!this.threeD) {
1088 this.threeD = true;
1089 setButtonColor(this.__button3D, Colors.getDefaultLayerColor(Registry.currentLayer), activeText);
1090 setButtonColor(this.__button2D, inactiveBackground, inactiveText);1091 this.renderer.loadJSON(Registry.currentDevice.toJSON());
1092 let cameraCenter = this.view.getViewCenterInMillimeters();
1093 let height = Registry.currentDevice.params.getValue("height") / 1000;
1087 if (!this.threeD) {
1088 this.threeD = true;
1089 setButtonColor(this.__button3D, Colors.getDefaultLayerColor(Registry.currentLayer), activeText);
1090 setButtonColor(this.__button2D, inactiveBackground, inactiveText);1091 this.renderer.loadJSON(Registry.currentDevice.toJSON());
1092 let cameraCenter = this.view.getViewCenterInMillimeters();
1093 let height = Registry.currentDevice.params.getValue("height") / 1000;
15 //Create the nouislider
16 let zoom_optimal = Math.log10(Registry.viewManager.view.computeOptimalZoom());
17 //Create the noUiSlider
18 noUiSlider.create(this.__zoomSlider, {19 start: [zoom_optimal],
20 connect: "lower",
21 range: {
172 let content = zipper.generate({
173 type: "blob"
174 });
175 saveAs(content, "Taguchi_DOE.zip");176 }
177
178 __generateOrthogonalDesign(orthogonalArrayElement, paramdata) {
56 throw new Error("Could not find HTML element for the grid resolution slider");
57 }
58 //Create the noUiSlider
59 noUiSlider.create(this.__gridResolutionSlider, { 60 start: [500],
61 connect: "lower",
62 range: {
18 slider.setAttribute("value", start);
19 slider.setAttribute("step", step);
20 p.appendChild(slider);
21 componentHandler.upgradeElement(slider, "MaterialSlider"); 22 div.appendChild(p);
23 return div;
24};
30 icon.className = "material-icons";
31 icon.innerHTML = iconString;
32 button.appendChild(icon);
33 componentHandler.upgradeElement(button, "MaterialButton"); 34 return button;
35};
36
54 div.appendChild(span);
55 div.appendChild(error);
56 div.setAttribute("style", "margin-left: auto; margin-right: auto; display: block;width:65px;padding-top:0px;padding-bottom:5px;");
57 componentHandler.upgradeElement(div, "MaterialTextfield"); 58 return div;
59};
60
75 if (checked) input.checked = true;
76 input.className = "mdl-checkbox__input";
77 label.appendChild(input);
78 componentHandler.upgradeElement(label, "MaterialCheckbox"); 79 div.setAttribute("style", "margin-left: auto; margin-right: auto; display: block;width:12px;position:relative;");
80 div.appendChild(label);
81 return div;
55 type: "blob"
56 });
57
58 saveAs(content, Registry.currentDevice.getName() + ".zip");59 }
60}
65 let json = new Blob([JSON.stringify(Registry.viewManager.generateExportJSON())], {
66 type: "application/json"
67 });
68 saveAs(json, Registry.currentDevice.getName() + ".json");69 }
70}
52 let content = zipper.generate({
53 type: "blob"
54 });
55 saveAs(content, "device_layers.zip");56 }
57 };
58
40 // if(this.__paramsToChange['position']){
41 // delete this.__paramsToChange['position'];
42 // }
43 let allcomponents = Registry.currentDevice.getComponents(); 44
45 let similarcomponents = [];
46
29 this.__componentTable.deleteRow(-1);
30 }
31
32 let selectedcomponent = Registry.viewManager.view.selectedComponents[0]; 33 let selectedcomponenttype = selectedcomponent.getType();
34 let params = selectedcomponent.getParams();
35 this.__paramsToChange = {};
4// import SimpleQueue from "../../utils/simpleQueue";
5// var PageSetup = require("../pageSetup");
6
7export default class CopyTool extends positionTool {8 // constructor(typeString, setString, )
9}
60 }
61
62 abort() {
63 ref.dragging = false; 64 if (this.currentTarget) {
65 this.currentTarget.remove();
66 }
112 }
113
114 for (let i in this.__connections) {
115 let render = Registry.currentDevice.getFeatureByID(this.__connections[i]);116 bounds = render.bounds;
117 if (bounds.x < xmin) {
118 xmin = bounds.x;
95 let bounds;
96
97 for (let i in this.__components) {
98 let render = Registry.currentDevice.getFeatureByID(this.__components[i]); 99 bounds = render.bounds;
100 if (bounds.x < xmin) {
101 xmin = bounds.x;
70 }
71
72 for (let i in this.__otherFeatures) {
73 let render = Registry.currentDevice.getFeatureByID(this.__otherFeatures[i]); 74 render.selected = true;
75 }
76 }
64 for (let i in this.__connections) {
65 let connection = Registry.currentDevice.getConnectionByID(this.__connections[i]);
66 for (let j in connection.features) {
67 let render = Registry.currentDevice.getFeatureByID(connection.features[i]); 68 render.selected = true;
69 }
70 }
62 }
63
64 for (let i in this.__connections) {
65 let connection = Registry.currentDevice.getConnectionByID(this.__connections[i]); 66 for (let j in connection.features) {
67 let render = Registry.currentDevice.getFeatureByID(connection.features[i]);
68 render.selected = true;
Variables that aren't defined, but accessed may throw reference errors at runtime.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular
text/javascript
scripts. Using variables that are injected by scripts included in an HTML file is currently not supported.
Potential ReferenceError
s may result from misspellings of variable and parameter names, or accidental implicit globals (for example, forgetting the var
keyword in a for
loop initializer).
Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/
comment, or specified in the globals key in the configuration file.
A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML).
Bad Practice
const foo = someFunction(); // `someFunction` is not defined
const bar = baz + 1; // 'baz' is undeclared
Recommended
import { someFunction } from 'some-file';
const baz = Math.random();
const foo = someFunction();
const bar = baz + 1;