You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to be able to specify a callback function that gets called when starting on a new drawing file. For example:
state=null# global variableexportonNewDrawing=->state= [] # new proposalexportdefault->...sometimesmodifystatetocarrydatatofuture cells...
This could also be used as a way to (manually) implement symbol aliases (#68) within a drawing file.
Note that an alternative/workaround right now is to add data to the Context object. This is shared within each drawing but no more.
Another application: preprocessing the drawing. This is arguably a better time to modify a drawing than #69. Maybe even allow returning some global content to draw like #81? But maybe makes more sense to do such global drawing after the layout.
# Example 1: computeexportbeforeDrawing= (drawing) ->for row, i indrawing.keysfor char, j in row
# do some computation / walking through the drawing# to detect things that will be used later# maybe return content to draw?# Example 2: configuration in first row of drawingexportbeforeDrawing= (drawing) ->firstRow=drawing.keys.shift() # remove first row from drawing!# set some settings based on firstRow
For symmetry with #81, could maybe be called beforeDrawing.
Could even modify keys to be non-strings (e.g. objects), as this happens after coercion to String.
The text was updated successfully, but these errors were encountered:
It would be useful to be able to specify a callback function that gets called when starting on a new drawing file. For example:
This could also be used as a way to (manually) implement symbol aliases (#68) within a drawing file.
Note that an alternative/workaround right now is to add data to the
Context
object. This is shared within each drawing but no more.Another application: preprocessing the drawing. This is arguably a better time to modify a drawing than #69. Maybe even allow returning some global content to draw like #81? But maybe makes more sense to do such global drawing after the layout.
For symmetry with #81, could maybe be called
beforeDrawing
.Could even modify keys to be non-strings (e.g. objects), as this happens after coercion to String.
The text was updated successfully, but these errors were encountered: