EnvironmentContext
Everything an environment knows about itself while mounted: its node, its place in the document, its state and the services the host provides.
@internote/canvas-sdkOn this page
import { EnvironmentContext } from '@internote/canvas-sdk';The surface receives it as ctx, and the toolbar, footer, animation and freeParameters functions of the definition receive the same object. The host keeps step, isFocused and isPresenting current on it.
Reading the node's attributes goes through animation, which resolves a keyframed attribute to its value at this moment; the node itself carries the raw values as the document does.
#Fields
animationEnvironmentAnimationRuntime<EnvironmentContext>assetsRecord<string, string> | nullnull means the manifest has not arrived yet, as with files.
datasets@data datasets by id, which an attribute binding a column (values: #gdp.gdppc) resolves against. Attached CSV files are already folded in, so an attached dataset reads like an inline one.Record<string, ChalkDataset>environmentNamegraph: also its node's identifier.stringfiles.geojson. The environment that understands such a file parses it itself; attached CSVs are already in datasets and are not read from here.Record<string, string> | nullnull means the file manifest has not arrived yet, which is a wait rather than an absence. An empty object means there are no files.
footerFooterAccessidentityEnvironmentIdentityisFocusedbooleanisPresentingbooleannodeCompiledNodeparametersslider:a written inside one graph is the same a a second graph beside it reads.SceneParameterAccessrunnerCodeRunnerstepnumberstepAnimationRemainingMsnumberThe same reckoning the playback control uses to offer a replay: the step's span measured from its entry, frozen while paused, and restarted by a replay.
stepCountnumberstillisStill, which also honours a reader who asked for reduced motion.booleanstorageCanvasStoragetaskstasks declared, by the same keys. A report for a part it did not declare is ignored.TaskReporterDeclared in packages/canvas-sdk/src/environment/types.ts:53.