Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const LAYOUT_LIST:string = "List";
const LAYOUT_COMBO:string = "ComboBox";
const LAYOUT_VSLIDER:string = "VSlider";
const LAYOUT_HSLIDER:string = "HSlider";
const menuOptions:string[] = [LAYOUT_LIST, LAYOUT_COMBO, LAYOUT_HSLIDER, LAYOUT_VSLIDER];
export default class SessionStateMenuTool extends AbstractVisTool
{
static WEAVE_INFO = Weave.setClassInfo(SessionStateMenuTool, {
id: "weavejs.tool.SessionStateMenu",
label: "Session State Menu Tool",
interfaces: [IVisTool/*, ILinkableObjectWithNewProperties*/],
deprecatedIds: ["weave.ui::SessionStateMenuTool"]
});
public selectedChoice = Weave.linkableChild(this, LinkableString, this.forceUpdate, true);
public layoutMode = Weave.linkableChild(this, new LinkableString(LAYOUT_LIST, this.verifyLayoutMode), this.forceUpdate, true);
public autoRecord = Weave.linkableChild(this, new LinkableBoolean(false), this.forceUpdate);
choices = Weave.linkableChild(this, new LinkableHashMap(LinkableVariable));
targets = Weave.linkableChild(this, new LinkableHashMap(LinkableDynamicObject));
panelTitle = Weave.linkableChild(this, LinkableString);
pendingApply:Boolean =false;
verifyLayoutMode(value:string):boolean
{
return menuOptions.indexOf(value) >= 0;
}
get title():string
{
constructor (props:IVisToolProps)
{
super(props);
this.state = {isPlaying: false};
this.targetToolPath.addGroupedCallback(this, this.setToolWatcher);
this.selectedAttribute.addGroupedCallback(this, this.onSelectedAttribute);
this.playEnabled.addGroupedCallback(this, this.forceUpdate);
}
//session properties
public panelTitle = Weave.linkableChild(this, LinkableString);
public choices = Weave.linkableChild(this, new LinkableHashMap(IAttributeColumn), this.forceUpdate, true );
public layoutMode = Weave.linkableChild(this, new LinkableString(LAYOUT_LIST, this.verifyLayoutMode), this.forceUpdate, true);
public selectedAttribute = Weave.linkableChild(this, LinkableVariable, this.forceUpdate, true);
public targetToolPath = Weave.linkableChild(this, new LinkableVariable(Array));
public targetAttribute = Weave.linkableChild(this, LinkableString);
public playEnabled = Weave.linkableChild(this, LinkableBoolean);
public playbackIntervalSeconds = Weave.linkableChild(this, new LinkableNumber(1));
toolWatcher = Weave.privateLinkableChild(this, LinkableWatcher);
altText:LinkableString = Weave.linkableChild(this, new LinkableString(this.panelTitle.value));
verifyLayoutMode(value:string):boolean
{
return LAYOUT_OPTIONS_MULTIPLE.indexOf(value) >= 0;
}
//callback for targetToolPath
setToolWatcher =():void =>
{
});
constructor (props:IVisToolProps)
{
super(props);
this.state = {isPlaying: false};
this.targetToolPath.addGroupedCallback(this, this.setToolWatcher);
this.selectedAttribute.addGroupedCallback(this, this.onSelectedAttribute);
this.playEnabled.addGroupedCallback(this, this.forceUpdate);
}
//session properties
public panelTitle = Weave.linkableChild(this, LinkableString);
public choices = Weave.linkableChild(this, new LinkableHashMap(IAttributeColumn), this.forceUpdate, true );
public layoutMode = Weave.linkableChild(this, new LinkableString(LAYOUT_LIST, this.verifyLayoutMode), this.forceUpdate, true);
public selectedAttribute = Weave.linkableChild(this, LinkableVariable, this.forceUpdate, true);
public targetToolPath = Weave.linkableChild(this, new LinkableVariable(Array));
public targetAttribute = Weave.linkableChild(this, LinkableString);
public playEnabled = Weave.linkableChild(this, LinkableBoolean);
public playbackIntervalSeconds = Weave.linkableChild(this, new LinkableNumber(1));
toolWatcher = Weave.privateLinkableChild(this, LinkableWatcher);
altText:LinkableString = Weave.linkableChild(this, new LinkableString(this.panelTitle.value));
verifyLayoutMode(value:string):boolean
{
return LAYOUT_OPTIONS_MULTIPLE.indexOf(value) >= 0;
}
//callback for targetToolPath
setToolWatcher =():void =>
const LAYOUT_COMBO:string = "ComboBox";
const LAYOUT_VSLIDER:string = "VSlider";
const LAYOUT_HSLIDER:string = "HSlider";
const menuOptions:string[] = [LAYOUT_LIST, LAYOUT_COMBO, LAYOUT_HSLIDER, LAYOUT_VSLIDER];
export default class SessionStateMenuTool extends AbstractVisTool
{
static WEAVE_INFO = Weave.setClassInfo(SessionStateMenuTool, {
id: "weavejs.tool.SessionStateMenu",
label: "Session State Menu Tool",
interfaces: [IVisTool/*, ILinkableObjectWithNewProperties*/],
deprecatedIds: ["weave.ui::SessionStateMenuTool"]
});
public selectedChoice = Weave.linkableChild(this, LinkableString, this.forceUpdate, true);
public layoutMode = Weave.linkableChild(this, new LinkableString(LAYOUT_LIST, this.verifyLayoutMode), this.forceUpdate, true);
public autoRecord = Weave.linkableChild(this, new LinkableBoolean(false), this.forceUpdate);
choices = Weave.linkableChild(this, new LinkableHashMap(LinkableVariable));
targets = Weave.linkableChild(this, new LinkableHashMap(LinkableDynamicObject));
panelTitle = Weave.linkableChild(this, LinkableString);
pendingApply:Boolean =false;
verifyLayoutMode(value:string):boolean
{
return menuOptions.indexOf(value) >= 0;
}
get title():string
{
return MiscUtils.evalTemplateString(this.panelTitle.value, this);
static WEAVE_INFO = Weave.setClassInfo(PIXIScatterPlot, {
id: "weavejs.tool.PIXIScatterPlot",
label: "Scatter Plot",
interfaces: [
IVisTool,
ILinkableObjectWithNewProperties,
ISelectableAttributes,
]//,
//deprecatedIds: ["weave.visualization.tools::ScatterPlotTool"]
});
element:HTMLDivElement;
renderer:PIXI.WebGLRenderer | PIXI.CanvasRenderer;
graphics:PIXI.Graphics = new PIXI.Graphics();
stage:PIXI.Container = new PIXI.Container();
plotter:ScatterPlotPlotter = Weave.linkableChild(this, ScatterPlotPlotter, this.forceUpdate, true);
constructor(props:PIXIScatterPlotProps)
{
super(props);
this.plotter.spatialCallbacks.addGroupedCallback(this, this.forceUpdate);
this.plotter.filteredKeySet.keyFilter.targetPath = ['defaultSubsetKeyFilter'];
}
componentDidMount()
{
var canvas = ReactDOM.findDOMNode(this) as HTMLCanvasElement;
this.renderer = PIXI.autoDetectRenderer(800, 600, {
view: canvas,
transparent: true,
resolution: DOMUtils.getWindow(canvas).devicePixelRatio
});