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
Add the code for the topic in the OpenSpace engine, under e.g.,
src/topic/Write a schema for the Topic (see Writing a JSON Schema for a detailed how-to guide)
Register the Topic in the engine
Register the Topic class in
src/topic/server.cppwith a unique ID, e.g.,propertyTreeAdd the schema to
registerCoreSchemasincore_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.