learntextvis / code-samples

draft code to communicate ideas
0 stars 0 forks source link

What should the Text Visualization interface be? #14

Open vlandham opened 8 years ago

vlandham commented 8 years ago

To increase reusability, it would be great if the text visualization components built had a very similar API / interface in how they consumed and presented data and configuration.

Here is a suggestion:

The primary input for each visualization is an array of documents.

Each entry in the document array will map to exactly one visualization instance.

Each document will contain the processed tokens, counts, and other values needed to drive the visualization.

Example: for the concordance plot, each document will contain an array of tokens. Each document will result in a separate concordance plot displayed for that document. For the wordcloud, each document will contain an array of tokens and scores/counts. Each document will result in a new wordcloud displayed for that document.

Configuration will be in the form of a JSON formatted series of key value pairs (JS object).

Each visualization component will have its own set of configuration options. When similar options are available, configuration naming should remain consistent.

iros commented 8 years ago

What about shared configuration options? If someone wishes to set a color scheme for all N visualizations, can they do that with a shared object first?