@@ -3,7 +3,7 @@ import clamp from 'clamp'
33import utils from '../utils'
44import { builtIn as evaluate } from '../helpers/eval'
55
6- import { Chart } from '../index '
6+ import { Chart } from '../chart '
77import { FunctionPlotDatum } from '../types'
88
99function checkAsymptote (
@@ -106,15 +106,15 @@ function split(chart: Chart, d: FunctionPlotDatum, data: number[][]) {
106106}
107107
108108function linear ( chart : Chart , d : FunctionPlotDatum , range : [ number , number ] , n : number ) {
109- const allX = utils . space ( chart , range , n )
109+ const allX = utils . space ( chart . options . xAxis . type , range , n )
110110 const yDomain = chart . meta . yScale . domain ( )
111111 const yDomainMargin = yDomain [ 1 ] - yDomain [ 0 ]
112112 const yMin = yDomain [ 0 ] - yDomainMargin * 1e5
113113 const yMax = yDomain [ 1 ] + yDomainMargin * 1e5
114114 let data = [ ]
115115 for ( let i = 0 ; i < allX . length ; i += 1 ) {
116116 const x = allX [ i ]
117- const y = evaluate ( d , 'fn' , { x : x } )
117+ const y = evaluate ( d , 'fn' , { x } )
118118 if ( utils . isValidNumber ( x ) && utils . isValidNumber ( y ) ) {
119119 data . push ( [ x , clamp ( y , yMin , yMax ) ] )
120120 }
@@ -127,7 +127,7 @@ function parametric(chart: Chart, d: FunctionPlotDatum, range: [number, number],
127127 // range is mapped to canvas coordinates from the input
128128 // for parametric plots the range will tell the start/end points of the `t` param
129129 const parametricRange = d . range || [ 0 , 2 * Math . PI ]
130- const tCoords = utils . space ( chart , parametricRange , nSamples )
130+ const tCoords = utils . space ( chart . options . xAxis . type , parametricRange , nSamples )
131131 const samples = [ ]
132132 for ( let i = 0 ; i < tCoords . length ; i += 1 ) {
133133 const t = tCoords [ i ]
@@ -142,7 +142,7 @@ function polar(chart: Chart, d: FunctionPlotDatum, range: [number, number], nSam
142142 // range is mapped to canvas coordinates from the input
143143 // for polar plots the range will tell the start/end points of the `theta` param
144144 const polarRange = d . range || [ - Math . PI , Math . PI ]
145- const thetaSamples = utils . space ( chart , polarRange , nSamples )
145+ const thetaSamples = utils . space ( chart . options . xAxis . type , polarRange , nSamples )
146146 const samples = [ ]
147147 for ( let i = 0 ; i < thetaSamples . length ; i += 1 ) {
148148 const theta = thetaSamples [ i ]
0 commit comments