MCPcopy Create free account
hub / github.com/microsoft/SandDance / Signal

Function Signal

docs/app/js/sanddance-app.js:11286–11311  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

11284// Licensed under the MIT license.
11285var _base = require("../base");
11286function Signal(props) {
11287 if (!props.explorer.viewer || !props.signal) return null;
11288 if (props.signal.bind) {
11289 const input = props.signal.bind.input;
11290 if (input) {
11291 const fn = map[input];
11292 if (fn) {
11293 const prefix = props.prefix ? `${props.prefix} ` : "";
11294 let initialValue;
11295 try {
11296 initialValue = props.explorer.viewer.vegaViewGl.signal(props.signal.name);
11297 } catch (error) {
11298 // continue regardless of error
11299 }
11300 const control = fn(prefix, props.signal.bind, initialValue, (value)=>{
11301 props.onChange && props.onChange(value);
11302 props.explorer.signal(props.signal.name, value, props.newViewStateTarget);
11303 }, props.disabled, props.collapseLabel, props.componentRef);
11304 return (0, _base.base).react.createElement("div", {
11305 className: "sanddance-signal"
11306 }, control);
11307 }
11308 }
11309 }
11310 return null;
11311}
11312const map = {};
11313map["range"] = (prefix, bind, initialValue, onChange, disabled, collapseLabel, ref)=>{
11314 return (0, _base.base).react.createElement((0, _base.base).fluentUI.Slider, {

Callers

nothing calls this directly

Calls 2

fnFunction · 0.70
signalMethod · 0.45

Tested by

no test coverage detected