PabloLeon / model-driven-journalism

0 stars 0 forks source link

JSON specs for articles #12

Closed PabloLeon closed 7 years ago

PabloLeon commented 7 years ago

I need a JSON spec for the article structure.

Additionally the user might have an accumulated "Inventory" of previously made decisions, say chosen targets, chosen predictors etc..

A good candidate for a JSON spec might be one of "choose your own adventure" packages. Have a look at: https://github.com/pistacchio/Dedalus https://github.com/Nanofus/novel.js

PabloLeon commented 7 years ago

Slides are self-contained. But actions pass an id + type (value, choice) + potentially value and need to correspond to some data transformations? For example if I choose a predictor, how is this translated to the dataset?

Simple version: hardcode predictor+ id -> action, option + id -> action, value selection + id + value -> action option + id always should choose one of several columns in the data, value selection should always test against a value in the id column in the data (we would need to specify if we want to be < or > than).

A more flexible approach could be a query dsl: https://github.com/jsonata-js/jsonata There is more exciting ways to (possibly) do this, e.g. graphql schemas look suspiciously like JSON, see https://github.com/gatsbyjs/gatsby/issues/420 or https://github.com/superawesomelabs/leo and could potentially even be inferred automatically from examples (https://github.com/aweary/json-to-graphql)?