How to use the weavejs.Weave.linkableChild function in weavejs

To help you get started, we’ve selected a few weavejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WeaveTeam / WeaveJS / WeaveApp / src / weaveapp / tool / SessionStateMenuTool.tsx View on Github external
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
	{
github WeaveTeam / WeaveJS / WeaveApp / src / weaveapp / tool / AttributeMenuTool.tsx View on Github external
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 =>
	{
github WeaveTeam / WeaveJS / WeaveApp / src / weaveapp / tool / AttributeMenuTool.tsx View on Github external
});

	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 =>
github WeaveTeam / WeaveJS / WeaveApp / src / weaveapp / tool / SessionStateMenuTool.tsx View on Github external
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);
github WeaveTeam / WeaveJS / WeaveApp / src / weaveapp / tool / PIXIScatterPlot.tsx View on Github external
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
		});

weavejs

Application architecture library for building modern web applications

MPL-2.0
Latest version published 8 years ago

Package Health Score

39 / 100
Full package analysis