How to use the plywood.AttributeInfo.toJSs function in plywood

To help you get started, we’ve selected a few plywood examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github allegro / turnilo / src / common / models / data-cube / data-cube.ts View on Github external
if (this.group) js.group = this.group;
    if (this.introspection) js.introspection = this.introspection;
    if (this.subsetFormula) js.subsetFormula = this.subsetFormula;
    if (this.defaultTimezone) js.defaultTimezone = this.defaultTimezone.toJS();
    if (this.defaultFilter) js.defaultFilter = this.defaultFilter.toJS();
    if (this.defaultSplitDimensions) js.defaultSplitDimensions = this.defaultSplitDimensions.toArray();
    if (this.defaultDuration) js.defaultDuration = this.defaultDuration.toJS();
    if (this.defaultSortMeasure) js.defaultSortMeasure = this.defaultSortMeasure;
    if (this.defaultSelectedMeasures) js.defaultSelectedMeasures = this.defaultSelectedMeasures.toArray();
    if (this.defaultPinnedDimensions) js.defaultPinnedDimensions = this.defaultPinnedDimensions.toArray();
    if (this.rollup) js.rollup = true;
    if (this.maxSplits) js.maxSplits = this.maxSplits;
    if (this.maxQueries) js.maxQueries = this.maxQueries;
    if (this.timeAttribute) js.timeAttribute = this.timeAttribute.name;
    if (this.attributeOverrides.length) js.attributeOverrides = AttributeInfo.toJSs(this.attributeOverrides);
    if (this.attributes.length) js.attributes = AttributeInfo.toJSs(this.attributes);
    if (this.derivedAttributes) js.derivedAttributes = Expression.expressionLookupToJS(this.derivedAttributes);
    if (Object.keys(this.options).length) js.options = this.options;
    return js;
  }
github allegro / turnilo / src / common / models / data-cube / data-cube.mocha.ts View on Github external
formula: "$language.lookup(wiki_language_lookup)"
          }
        ],
        measures: [
          {
            name: "added",
            formula: "$main.sum($added)"
          },
          {
            name: "addedByDeleted",
            formula: "$main.sum($added) / $main.sum($deleted)"
          }
        ]
      }, context);

      expect(AttributeInfo.toJSs(dataCube.deduceAttributes())).to.deep.equal([
        {
          name: "__time",
          type: "TIME"
        },
        {
          name: "page",
          type: "STRING"
        },
        {
          name: "user",
          type: "STRING"
        },
        {
          name: "language",
          type: "STRING"
        },
github allegro / turnilo / src / common / models / data-cube / data-cube.ts View on Github external
if (this.extendedDescription) js.extendedDescription = this.extendedDescription;
    if (this.group) js.group = this.group;
    if (this.introspection) js.introspection = this.introspection;
    if (this.subsetFormula) js.subsetFormula = this.subsetFormula;
    if (this.defaultTimezone) js.defaultTimezone = this.defaultTimezone.toJS();
    if (this.defaultFilter) js.defaultFilter = this.defaultFilter.toJS();
    if (this.defaultSplitDimensions) js.defaultSplitDimensions = this.defaultSplitDimensions.toArray();
    if (this.defaultDuration) js.defaultDuration = this.defaultDuration.toJS();
    if (this.defaultSortMeasure) js.defaultSortMeasure = this.defaultSortMeasure;
    if (this.defaultSelectedMeasures) js.defaultSelectedMeasures = this.defaultSelectedMeasures.toArray();
    if (this.defaultPinnedDimensions) js.defaultPinnedDimensions = this.defaultPinnedDimensions.toArray();
    if (this.rollup) js.rollup = true;
    if (this.maxSplits) js.maxSplits = this.maxSplits;
    if (this.maxQueries) js.maxQueries = this.maxQueries;
    if (this.timeAttribute) js.timeAttribute = this.timeAttribute.name;
    if (this.attributeOverrides.length) js.attributeOverrides = AttributeInfo.toJSs(this.attributeOverrides);
    if (this.attributes.length) js.attributes = AttributeInfo.toJSs(this.attributes);
    if (this.derivedAttributes) js.derivedAttributes = Expression.expressionLookupToJS(this.derivedAttributes);
    if (Object.keys(this.options).length) js.options = this.options;
    return js;
  }
github allegro / turnilo / src / client / views / settings-view / data-cube-edit / data-cube-edit.tsx View on Github external
        valueToString={(value: AttributeInfo[]) => value ? JSON.stringify(AttributeInfo.toJSs(value), null, 2) : undefined}
        stringToValue={(str: string) => str ? AttributeInfo.fromJSs(JSON.parse(str)) : undefined}