FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Charts: Add props to ChartLabel by dlabrecq · Pull Request #3028 · patternfly/patternfly-react · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .tsx  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import * as React from 'react';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { defaults } from 'lodash';
import { StringOrNumberOrCallback, VictoryLabel, VictoryLabelProps } from 'victory';
import {
StringOrNumberOrCallback,
TextAnchorType,
VerticalAnchorType,
VictoryLabel,
VictoryLabelProps
} from 'victory';
import { ChartCommonStyles } from '../ChartTheme';

export enum ChartLabelDirection {
Expand All @@ -16,8 +22,6 @@ export enum ChartLabelPlacement {
vertical = 'vertical'
}

type TextAnchorType = 'start' | 'middle' | 'end' | 'inherit';

/**
* See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/victory/index.d.ts
*/
Expand Down Expand Up @@ -135,19 +139,16 @@ export interface ChartLabelProps extends VictoryLabelProps {
/**
* The textAnchor prop defines how the text is horizontally positioned relative to the given `x` and `y` coordinates.
*/
// Todo: function not working as type
// textAnchor?: TextAnchorType | { (): TextAnchorType };
textAnchor?: TextAnchorType | (() => TextAnchorType);
/**
* The transform prop applies a transform to the rendered `<text>` element.
* In addition to being a string, it can be an object containing transform definitions for easier authoring.
*/
// Todo: function not working as type
// transform?: string | {} | { (): string | {} };
transform?: string | {} | (() => string);
/**
* The verticalAnchor prop defines how the text is vertically positioned relative to the given `x` and `y` coordinates
*/
// Todo: function not working as type
// verticalAnchor?: VerticalAnchorType | { (): VerticalAnchorType };
verticalAnchor?: VerticalAnchorType | (() => VerticalAnchorType);
/**
* The x prop defines the x coordinate to use as a basis for horizontal positioning.
*/
Expand Down

Back | FazBrowse Home | New Git URL