An Editor instance requires the following 2 functional arguments:
transformer A function that translates the most up-to-date
editor content into a format consumed by another
module. For example, the other module can be the messier-61-graph!Graph module, which consumes the some input
of type messier-61-graph!GraphData; in this case, the transformer function
simply takes editorContentLines as the most up-to-date editor content, parses it, and construct a
messier-61-graph!GraphData instance as its return value
exporter A function that takes the output of the transformer and load it into somewhere else. For example,
in our messier-61-graph!Graph module example mentioned above, the exporter can simply be a
set function of a state variable. This
allows us to implement some "realtime graph editing" where user enters some text in Editor; that text can be parsed
by the transformer to generate some knowledge graph data; then the data gets immediately loaded into the Graph
module for rendering
A Editor is an abstraction layer for
An Editor instance requires the following 2 functional arguments:
transformer
function simply takeseditorContentLines
as the most up-to-date editor content, parses it, and construct a messier-61-graph!GraphData instance as its return valuetransformer
and load it into somewhere else. For example, in our messier-61-graph!Graph module example mentioned above, theexporter
can simply be a set function of a state variable. This allows us to implement some "realtime graph editing" where user enters some text in Editor; that text can be parsed by thetransformer
to generate some knowledge graph data; then the data gets immediately loaded into the Graph module for renderingReturns
An knowledge graph editor