qlik-oss / picasso.js

A charting library streamlined for building interactive visualizations for the Qlik product suites.
https://qlik.dev/libraries-and-tools/picassojs
MIT License
188 stars 55 forks source link

documentation typos #23

Closed skokenes closed 6 years ago

skokenes commented 6 years ago

Working through the q plugin docs at https://picassojs.com/docs/plugin-q.html and noticing some issues:

import picasso from 'picasso.js';
import picassoQ from 'picasso-plugin-q';

picasso.use(pluginQ); // register

should say .use(picassoQ), not .use(pluginQ):

import picasso from 'picasso.js';
import picassoQ from 'picasso-plugin-q';

picasso.use(picassoQ); // register

const ds = picasso.data('q')({
  key: 'qHyperCube', // path to the hypercube from the layout
  data: layout.qHypercube
});

has qHyperCube misspelled. should say:

const ds = picasso.data('q')({
  key: 'qHyperCube', // path to the hypercube from the layout
  data: layout.qHyperCube
});

Also, the "key" string doesn't seem to matter, so not sure why it's needed at this point in time.

miralemd commented 6 years ago

ah, thanks for noticing!

miralemd commented 6 years ago

the key property in this particular case is there primarily for the sake of consistency with when sending multiple hypercubes to a chart instance. It is used when identifying the origin of a field.

Use case: find the first measure with qMax > 100 :

const field = ds.field(f => f.type() === 'measure' && f.raw().qMax > 100);
console.log(field.id()); // qHyperCube/qMeasureInfo/2