How to use the plottable.Scales.Linear function in plottable

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

github devinit / datahub / src / components / organisms / Charts / components / TreeMap / TreeMap.tsx View on Github external
private createAxes(props: TreeMapProps) {
    this.xScale = new Scales.Linear();
    this.yScale = new Scales.Linear();
    this.resetDomain(props);
  }
github devinit / datahub / src / components / organisms / Charts / components / BarChart / BarChart.tsx View on Github external
} else if (this.xScale instanceof Scales.Time && typeof xConfigs.tickingStep !== 'number') {
          if (xConfigs.axisMin) {
            this.xScale.domainMin(parseAxisMinMaxToDate(xConfigs.axisMin));
          }
          if (xConfigs.axisMax) {
            this.xScale.domainMax(parseAxisMinMaxToDate(xConfigs.axisMax));
          }
        }
      }
      if (this.xAxis instanceof Axes.Time && xConfigs.timeFormat) {
        const tickingStep = typeof xConfigs.tickingStep !== 'number' ? xConfigs.tickingStep : {};
        this.xAxis.axisConfigurations([ setTimeAxisTickingFormat(xConfigs.timeFormat, tickingStep || {}) ]);
      }
    }

    this.yScale = new Scales.Linear();
    this.yAxis = getAxis(yConfigs, this.yScale) as Axes.Numeric;

    if (yConfigs.show) {
      chartTable.add(this.yAxis, 1, 1);

      this.yAxis.margin(yConfigs.margin);
      if (typeof yConfigs.tickingStep === 'number') {
        const yScaleTickGenerator = Scales.TickGenerators.intervalTickGenerator(yConfigs.tickingStep);
        this.yScale.tickGenerator(yScaleTickGenerator);
      }
    }
  }
github devinit / datahub / src / components / organisms / Charts / components / LineChart / LineChart.tsx View on Github external
} else if (this.xScale instanceof Scales.Time && typeof xConfigs.tickingStep !== 'number') {
          if (xConfigs.axisMin) {
            this.xScale.domainMin(parseAxisMinMaxToDate(xConfigs.axisMin));
          }
          if (xConfigs.axisMax) {
            this.xScale.domainMax(parseAxisMinMaxToDate(xConfigs.axisMax));
          }
        }
      }
      if (this.xAxis instanceof Axes.Time && xConfigs.timeFormat) {
        const tickingStep = typeof xConfigs.tickingStep !== 'number' ? xConfigs.tickingStep : {};
        this.xAxis.axisConfigurations([ setTimeAxisTickingFormat(xConfigs.timeFormat, tickingStep || {}) ]);
      }
    }

    this.yScale = new Scales.Linear();
    this.yAxis = getAxis(yConfigs, this.yScale) as Axes.Numeric;

    if (yConfigs.show) {
      chartTable.add(this.yAxis, 1, 1);

      this.yAxis.margin(yConfigs.margin);
      if (typeof yConfigs.tickingStep === 'number') {
        const yScaleTickGenerator = Scales.TickGenerators.intervalTickGenerator(yConfigs.tickingStep);
        this.yScale.tickGenerator(yScaleTickGenerator);
      }
    }
  }
github devinit / datahub / src / components / organisms / Charts / components / TreeMap / TreeMap.tsx View on Github external
private createAxes(props: TreeMapProps) {
    this.xScale = new Scales.Linear();
    this.yScale = new Scales.Linear();
    this.resetDomain(props);
  }