Creating a new OpenSpace Topic

This guide explains what a Topic is and how to create one: writing a schema and registering it in the engine. Once a Topic is created, see Update TypeScript types from OpenSpace build for how to generate and publish the corresponding TypeScript types in openspace-api-js so consuming repositories (for example, the WebGui) can use them.

What is a Topic?

@TODO: Add a short explanation of what a Topic is, how it fits the OpenSpace API, our philosophy of using Lua functions, vs Topics, vs Events. Do we also want to include a link or something to our existing Topics?

Create a new Topic

  1. Add the code for the topic in the OpenSpace engine, under e.g., src/topic/

  2. Write a schema for the Topic (see Writing a JSON Schema for a detailed how-to guide)

  3. Register the Topic in the engine

    1. Register the Topic class in src/topic/server.cpp with a unique ID, e.g., propertyTree

    2. Add the schema to registerCoreSchemas in core_registration.cpp

Using the Topic

The Topic is used via the JavaScript or Python APIs. Use the same ID registered in step 3 above to start the Topic.