-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(axis): log scale improvements and options #1014
Changes from 13 commits
4a91ad8
42ce439
7ef4e53
d6dcfec
d9c6125
ea7868c
af1c983
52f1e0d
ada219d
c8066f5
dc3459f
c0f2bde
fc4eee4
1a8d6f6
a26fd2c
9999d8b
019c3a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
import { $Values } from 'utility-types'; | ||
import { ComponentType } from 'react'; | ||
import React from 'react'; | ||
import { default as React_2 } from 'react'; | ||
import { ReactChild } from 'react'; | ||
|
||
// @public | ||
|
@@ -103,7 +103,7 @@ export interface ArcStyle { | |
// Warning: (ae-missing-release-tag) "AreaSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const AreaSeries: React.FunctionComponent<SpecRequiredProps & SpecOptionalProps>; | ||
export const AreaSeries: React_2.FunctionComponent<SpecRequiredProps & SpecOptionalProps>; | ||
|
||
// @public | ||
export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & { | ||
|
@@ -160,7 +160,7 @@ export interface ArrayNode extends NodeDescriptor { | |
// Warning: (ae-missing-release-tag) "Axis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const Axis: React.FunctionComponent<SpecRequired & SpecOptionals>; | ||
export const Axis: React_2.FunctionComponent<SpecRequired & SpecOptionals>; | ||
|
||
// @public (undocumented) | ||
export type AxisId = string; | ||
|
@@ -262,7 +262,7 @@ export interface BandFillColorAccessorInput { | |
// Warning: (ae-missing-release-tag) "BarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const BarSeries: React.FunctionComponent<SpecRequiredProps_2 & SpecOptionalProps_2>; | ||
export const BarSeries: React_2.FunctionComponent<SpecRequiredProps_2 & SpecOptionalProps_2>; | ||
|
||
// @public | ||
export type BarSeriesSpec = BasicSeriesSpec & Postfixes & { | ||
|
@@ -360,7 +360,7 @@ export type BrushEndListener = (brushArea: XYBrushArea) => void; | |
// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts | ||
// | ||
// @alpha | ||
export const BubbleSeries: React.FunctionComponent<SpecRequiredProps_3 & SpecOptionalProps_3>; | ||
export const BubbleSeries: React_2.FunctionComponent<SpecRequiredProps_3 & SpecOptionalProps_3>; | ||
|
||
// @alpha | ||
export type BubbleSeriesSpec = BasicSeriesSpec & { | ||
|
@@ -419,7 +419,7 @@ export interface Cell { | |
// Warning: (ae-missing-release-tag) "Chart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export class Chart extends React.Component<ChartProps, ChartState> { | ||
export class Chart extends React_2.Component<ChartProps, ChartState> { | ||
constructor(props: ChartProps); | ||
// (undocumented) | ||
componentDidMount(): void; | ||
|
@@ -428,9 +428,9 @@ export class Chart extends React.Component<ChartProps, ChartState> { | |
// (undocumented) | ||
static defaultProps: ChartProps; | ||
// (undocumented) | ||
dispatchExternalPointerEvent(event: PointerEvent): void; | ||
dispatchExternalPointerEvent(event: PointerEvent_2): void; | ||
// (undocumented) | ||
getChartContainerRef: () => React.RefObject<HTMLDivElement>; | ||
getChartContainerRef: () => React_2.RefObject<HTMLDivElement>; | ||
// (undocumented) | ||
getPNGSnapshot(options?: { | ||
backgroundColor: string; | ||
|
@@ -461,7 +461,7 @@ export interface ChartSizeObject { | |
|
||
// Warning: (ae-missing-release-tag) "ChartTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
// @public | ||
export const ChartTypes: Readonly<{ | ||
Global: "global"; | ||
Goal: "goal"; | ||
|
@@ -517,6 +517,11 @@ export type ColorVariant = $Values<typeof ColorVariant>; | |
// @public (undocumented) | ||
export type CompleteBoundedDomain = DomainBase & LowerBound & UpperBound; | ||
|
||
// Warning: (ae-missing-release-tag) "ContinuousDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export type ContinuousDomain = [min: number, max: number]; | ||
|
||
// Warning: (ae-missing-release-tag) "CrosshairStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
|
@@ -696,7 +701,7 @@ export const DEFAULT_TOOLTIP_TYPE: "vertical"; | |
// Warning: (ae-missing-release-tag) "DefaultSettingsProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export type DefaultSettingsProps = 'id' | 'chartType' | 'specType' | 'rendering' | 'rotation' | 'resizeDebounce' | 'animateData' | 'showLegend' | 'debug' | 'tooltip' | 'showLegendExtra' | 'theme' | 'legendPosition' | 'legendMaxDepth' | 'hideDuplicateAxes' | 'brushAxis' | 'minBrushDelta' | 'externalPointerEvents'; | ||
export type DefaultSettingsProps = 'id' | 'chartType' | 'specType' | 'rendering' | 'rotation' | 'resizeDebounce' | 'animateData' | 'showLegend' | 'debug' | 'tooltip' | 'showLegendExtra' | 'theme' | 'legendPosition' | 'legendMaxDepth' | 'hideDuplicateAxes' | 'brushAxis' | 'minBrushDelta' | 'externalPointerEvents' | 'yLogBase' | 'xLogBase'; | ||
|
||
// Warning: (ae-missing-release-tag) "DEPTH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
|
@@ -858,7 +863,7 @@ export function getNodeName(node: ArrayNode): string; | |
// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts | ||
// | ||
// @alpha (undocumented) | ||
export const Goal: React.FunctionComponent<SpecRequiredProps_8 & SpecOptionalProps_8>; | ||
export const Goal: React_2.FunctionComponent<SpecRequiredProps_8 & SpecOptionalProps_8>; | ||
|
||
// @alpha (undocumented) | ||
export interface GoalSpec extends Spec { | ||
|
@@ -923,7 +928,7 @@ export interface GroupBrushExtent { | |
} | ||
|
||
// @alpha (undocumented) | ||
export const GroupBy: React.FunctionComponent<GroupByProps>; | ||
export const GroupBy: React_2.FunctionComponent<GroupByProps>; | ||
|
||
// @alpha (undocumented) | ||
export type GroupByAccessor = (spec: Spec, datum: any) => string | number; | ||
|
@@ -952,7 +957,7 @@ export interface GroupBySpec extends Spec { | |
export type GroupId = string; | ||
|
||
// @alpha (undocumented) | ||
export const Heatmap: React.FunctionComponent<Pick<HeatmapSpec, 'id' | 'data'> & Partial<Omit<HeatmapSpec, 'chartType' | 'specType' | 'id' | 'data'>>>; | ||
export const Heatmap: React_2.FunctionComponent<Pick<HeatmapSpec, 'id' | 'data'> & Partial<Omit<HeatmapSpec, 'chartType' | 'specType' | 'id' | 'data'>>>; | ||
|
||
// Warning: (ae-missing-release-tag) "HeatmapBrushEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
|
@@ -1131,7 +1136,7 @@ export type HierarchyOfArrays = Array<ArrayEntry>; | |
// Warning: (ae-missing-release-tag) "HistogramBarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const HistogramBarSeries: React.FunctionComponent<SpecRequiredProps_4 & SpecOptionalProps_4>; | ||
export const HistogramBarSeries: React_2.FunctionComponent<SpecRequiredProps_4 & SpecOptionalProps_4>; | ||
|
||
// @public | ||
export type HistogramBarSeriesSpec = Omit<BarSeriesSpec, 'stackAccessors'> & { | ||
|
@@ -1273,7 +1278,7 @@ export const LIGHT_THEME: Theme; | |
// Warning: (ae-missing-release-tag) "LineAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const LineAnnotation: React.FunctionComponent<SpecRequiredProps_5 & SpecOptionalProps_5>; | ||
export const LineAnnotation: React_2.FunctionComponent<SpecRequiredProps_5 & SpecOptionalProps_5>; | ||
|
||
// @public | ||
export interface LineAnnotationDatum { | ||
|
@@ -1308,7 +1313,7 @@ export interface LineAnnotationStyle { | |
// Warning: (ae-missing-release-tag) "LineSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const LineSeries: React.FunctionComponent<SpecRequiredProps_6 & SpecOptionalProps_6>; | ||
export const LineSeries: React_2.FunctionComponent<SpecRequiredProps_6 & SpecOptionalProps_6>; | ||
|
||
// @public | ||
export type LineSeriesSpec = BasicSeriesSpec & HistogramConfig & { | ||
|
@@ -1340,6 +1345,19 @@ export interface LineStyle { | |
visible: boolean; | ||
} | ||
|
||
// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const LogBase: Readonly<{ | ||
Common: "common"; | ||
Binary: "binary"; | ||
Natural: "natural"; | ||
}>; | ||
|
||
// @public | ||
export type LogBase = $Values<typeof LogBase>; | ||
|
||
// @public (undocumented) | ||
export type LowerBoundedDomain = DomainBase & LowerBound; | ||
|
||
|
@@ -1410,6 +1428,11 @@ export interface OrderBy { | |
direction?: Direction; | ||
} | ||
|
||
// Warning: (ae-missing-release-tag) "OrdinalDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export type OrdinalDomain = (number | string)[]; | ||
|
||
// Warning: (ae-missing-release-tag) "PARENT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
|
@@ -1428,7 +1451,7 @@ export type PartialTheme = RecursivePartial<Theme>; | |
// Warning: (ae-missing-release-tag) "Partition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const Partition: React.FunctionComponent<SpecRequiredProps_7 & SpecOptionalProps_7>; | ||
export const Partition: React_2.FunctionComponent<SpecRequiredProps_7 & SpecOptionalProps_7>; | ||
|
||
// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts | ||
// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
|
@@ -1520,7 +1543,9 @@ export type Placement = $Values<typeof Placement>; | |
// Warning: (ae-missing-release-tag) "PointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export type PointerEvent = PointerOverEvent | PointerOutEvent; | ||
type PointerEvent_2 = PointerOverEvent | PointerOutEvent; | ||
|
||
export { PointerEvent_2 as PointerEvent } | ||
|
||
// Warning: (ae-missing-release-tag) "PointerEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
|
@@ -1558,7 +1583,7 @@ export interface PointerOverEvent extends BasePointerEvent { | |
// Warning: (ae-missing-release-tag) "PointerUpdateListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export type PointerUpdateListener = (event: PointerEvent) => void; | ||
export type PointerUpdateListener = (event: PointerEvent_2) => void; | ||
|
||
// Warning: (ae-missing-release-tag) "PointShape" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
|
@@ -1640,7 +1665,7 @@ export type RawTextGetter = (node: ShapeTreeNode) => string; | |
// Warning: (ae-missing-release-tag) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const RectAnnotation: React.FunctionComponent<Pick<RectAnnotationSpec, 'id' | 'dataValues'> & Partial<Omit<RectAnnotationSpec, 'chartType' | 'specType' | 'seriesType' | 'id' | 'dataValues' | 'domainType' | 'annotationType'>>>; | ||
export const RectAnnotation: React_2.FunctionComponent<Pick<RectAnnotationSpec, 'id' | 'dataValues'> & Partial<Omit<RectAnnotationSpec, 'chartType' | 'specType' | 'seriesType' | 'id' | 'dataValues' | 'domainType' | 'annotationType'>>>; | ||
|
||
// Warning: (ae-missing-release-tag) "RectAnnotationDatum" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
|
@@ -1724,7 +1749,9 @@ export interface ScalesConfig { | |
histogramPadding: number; | ||
} | ||
|
||
// @public | ||
// Warning: (ae-missing-release-tag) "ScaleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const ScaleType: Readonly<{ | ||
Linear: "linear"; | ||
Ordinal: "ordinal"; | ||
|
@@ -1736,7 +1763,7 @@ export const ScaleType: Readonly<{ | |
Threshold: "threshold"; | ||
}>; | ||
|
||
// @public (undocumented) | ||
// @public | ||
export type ScaleType = $Values<typeof ScaleType>; | ||
|
||
// Warning: (ae-missing-release-tag) "SectorGeomSpecY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
|
@@ -1847,6 +1874,8 @@ export interface SeriesSpec extends Spec { | |
// @public (undocumented) | ||
export type SeriesSpecs<S extends BasicSeriesSpec = BasicSeriesSpec> = Array<S>; | ||
|
||
// Warning: (ae-missing-release-tag) "SeriesTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const SeriesTypes: Readonly<{ | ||
Area: "area"; | ||
|
@@ -1855,13 +1884,13 @@ export const SeriesTypes: Readonly<{ | |
Bubble: "bubble"; | ||
}>; | ||
|
||
// @public (undocumented) | ||
// @public | ||
export type SeriesTypes = $Values<typeof SeriesTypes>; | ||
|
||
// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
// | ||
// @public (undocumented) | ||
export const Settings: React.FunctionComponent<SettingsSpecProps>; | ||
export const Settings: React_2.FunctionComponent<SettingsSpecProps>; | ||
|
||
// @public | ||
export interface SettingsSpec extends Spec { | ||
|
@@ -1923,10 +1952,12 @@ export interface SettingsSpec extends Spec { | |
showLegendExtra: boolean; | ||
theme?: PartialTheme | PartialTheme[]; | ||
tooltip: TooltipSettings; | ||
// Warning: (ae-forgotten-export) The symbol "Domain" needs to be exported by the entry point index.d.ts | ||
// | ||
// (undocumented) | ||
xDomain?: Domain | DomainRange; | ||
xDomain?: ContinuousDomain | OrdinalDomain | DomainRange; | ||
xLogBase: LogBase; | ||
xLogMinLimit?: number; | ||
yLogBase: LogBase; | ||
yLogMinLimit?: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can have multiple Y axis and "ideally" multiple yLogBase There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK see a26fd2c |
||
} | ||
|
||
// Warning: (ae-missing-release-tag) "SettingsSpecProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) | ||
|
@@ -1980,7 +2011,7 @@ export interface SimplePadding { | |
} | ||
|
||
// @alpha (undocumented) | ||
export const SmallMultiples: React.FunctionComponent<SmallMultiplesProps>; | ||
export const SmallMultiples: React_2.FunctionComponent<SmallMultiplesProps>; | ||
|
||
// @alpha (undocumented) | ||
export type SmallMultiplesProps = Partial<Omit<SmallMultiplesSpec, 'id' | 'chatType' | 'specType'>>; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { LogBase } from '../../src/scales/scale_continuous'; | ||
import { common } from '../page_objects'; | ||
|
||
describe('Scales stories', () => { | ||
it.each(Object.values(LogBase))('should render proper tick count', async (base) => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/scales--log-scale-options&knob-Log base_Y - Axis=${base}`, | ||
); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markov00 I was able to fix this error by upgrading the
api-extractor
but it made these changes toReact
. Any ideas?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This usually happens when you are using JSX without importing React or when importing react as
import * from React
but I've checked your PR and it doesn't seem to touch anything like that. I will investigate on it a bit