• A Editor is an abstraction layer for

    An Editor instance requires the following 2 functional arguments:

    1. 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
    2. 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

    Returns

    An knowledge graph editor

    Parameters

    • __namedParameters: {
          exporter: ((exportLocation: any) => void);
          transformer: ((editorContentLines: string[]) => any);
      }
      • exporter: ((exportLocation: any) => void)
          • (exportLocation: any): void
          • Parameters

            • exportLocation: any

            Returns void

      • transformer: ((editorContentLines: string[]) => any)
          • (editorContentLines: string[]): any
          • Parameters

            • editorContentLines: string[]

            Returns any

    Returns JSX.Element

Generated using TypeDoc