Commit d8e3cc45 authored by Vasily Belolapotkov's avatar Vasily Belolapotkov

refactor: rename interface IPlotSize to ISize

parent 928e48c7
......@@ -27,23 +27,22 @@ interface IPlots extends IRenderable<IPlotsProps> {
}
interface IPlotsProps {
plotSize: IPlotSize;
plotSize: ISize;
zoomConfig: IZoomConfig;
}
export interface IPlotContainer extends IRenderable<IPlotSize> {
export interface IPlotContainer extends IRenderable<ISize> {
renderPlots: (xAxis: Timestamp[], dataSets: IDataSet[]) => void;
renderAxes: () => void;
}
export interface IPlotConfig {
plotSize: IPlotSize;
plotSize: ISize;
zoom?: IZoomConfig;
axes?: IAxesConfig;
}
export interface IPlotSize {
// TODO: rename into ISize
export interface ISize {
width: number;
height: number;
}
......@@ -101,7 +100,7 @@ function makePlotContainer(
renderAxes,
});
function render(container: DOMContainerElement, plotSize: IPlotSize): void {
function render(container: DOMContainerElement, plotSize: ISize): void {
width = plotSize.width;
height = plotSize.height;
......@@ -120,7 +119,7 @@ function makePlotContainer(
plots.renderDataSets(xAxis, dataSets);
}
function getPlotsSize(): IPlotSize {
function getPlotsSize(): ISize {
const plotsHeight = plotAxesConfig.x ? height - xAxisHeight : height;
return {
width,
......
import { IChartStateController, Timestamp } from './chart-state';
import { DOMContainerElement, IRenderable } from './chart-component';
import { IPlotSize } from './plot';
import { ISize } from './plot';
import {
applyElementConfig,
makeSvgElement,
......@@ -8,8 +8,8 @@ import {
} from './ui-utils';
interface IXAxisProps {
plotSize: IPlotSize;
axisSize: IPlotSize;
plotSize: ISize;
axisSize: ISize;
}
export function makeXAxis(
......@@ -24,8 +24,8 @@ export function makeXAxis(
let xSvg: SVGElement;
let xSvgLabels: SVGElement;
let plotSize: IPlotSize;
let axisSize: IPlotSize;
let plotSize: ISize;
let axisSize: ISize;
let xScale: number;
let xOffset: number;
let xCoordsScale: number;
......
......@@ -5,10 +5,10 @@ import {
makeLinearAnimation,
makeSvgElement,
} from './ui-utils';
import { IPlotSize } from './plot';
import { ISize } from './plot';
interface IYAxisProps {
plotSize: IPlotSize;
plotSize: ISize;
}
export function makeYAxis(
......@@ -17,7 +17,7 @@ export function makeYAxis(
const stateController = chartStateController;
let svgAxis: SVGElement;
let plotSize: IPlotSize;
let plotSize: ISize;
// Y-axis
let currentSvgYLabels: SVGElement;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment