refactor(tech-radar): update moved prop type
This commit is contained in:
@@ -34,7 +34,7 @@ export interface RadarQuadrant {
|
||||
export interface RadarEntry {
|
||||
key: string; // react key
|
||||
id: string;
|
||||
moved: number;
|
||||
moved: -1 | 0 | 1;
|
||||
quadrant: RadarQuadrant;
|
||||
ring: RadarRing;
|
||||
title: string;
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import GetBBoxPolyfill from '../../utils/polyfills/getBBox';
|
||||
|
||||
import Radar from './Radar';
|
||||
import Radar, { Props } from './Radar';
|
||||
|
||||
const minProps = {
|
||||
const minProps: Props = {
|
||||
width: 500,
|
||||
height: 200,
|
||||
quadrants: [{ id: 'languages', name: 'Languages' }],
|
||||
|
||||
@@ -19,7 +19,7 @@ import RadarPlot from '../RadarPlot';
|
||||
import { Ring, Quadrant, Entry } from '../../utils/types';
|
||||
import { adjustQuadrants, adjustRings, adjustEntries } from './utils';
|
||||
|
||||
type Props = {
|
||||
export type Props = {
|
||||
width: number;
|
||||
height: number;
|
||||
quadrants: Quadrant[];
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import GetBBoxPolyfill from '../../utils/polyfills/getBBox';
|
||||
|
||||
import RadarBubble from './RadarBubble';
|
||||
import RadarBubble, { Props } from './RadarBubble';
|
||||
|
||||
const minProps = {
|
||||
const minProps: Props = {
|
||||
visible: true,
|
||||
text: 'RadarBubble',
|
||||
x: 2,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import React, { useRef, useLayoutEffect } from 'react';
|
||||
import { makeStyles, Theme } from '@material-ui/core';
|
||||
|
||||
type Props = {
|
||||
export type Props = {
|
||||
visible: boolean;
|
||||
text: string;
|
||||
x: number;
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import GetBBoxPolyfill from '../../utils/polyfills/getBBox';
|
||||
|
||||
import RadarEntry from './RadarEntry';
|
||||
import RadarEntry, { Props } from './RadarEntry';
|
||||
|
||||
const minProps = {
|
||||
const minProps: Props = {
|
||||
x: 2,
|
||||
y: 2,
|
||||
value: 2,
|
||||
|
||||
@@ -18,7 +18,7 @@ import React from 'react';
|
||||
import { makeStyles, Theme } from '@material-ui/core';
|
||||
import { WithLink } from '../../utils/components';
|
||||
|
||||
type Props = {
|
||||
export type Props = {
|
||||
x: number;
|
||||
y: number;
|
||||
value: number;
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import GetBBoxPolyfill from '../../utils/polyfills/getBBox';
|
||||
|
||||
import RadarFooter from './RadarFooter';
|
||||
import RadarFooter, { Props } from './RadarFooter';
|
||||
|
||||
const minProps = {
|
||||
const minProps: Props = {
|
||||
x: 2,
|
||||
y: 2,
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import React from 'react';
|
||||
import { makeStyles, Theme } from '@material-ui/core';
|
||||
|
||||
type Props = {
|
||||
export type Props = {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import GetBBoxPolyfill from '../../utils/polyfills/getBBox';
|
||||
|
||||
import RadarGrid from './RadarGrid';
|
||||
import RadarGrid, { Props } from './RadarGrid';
|
||||
|
||||
const minProps = {
|
||||
const minProps: Props = {
|
||||
radius: 5,
|
||||
rings: [{ id: 'use', name: 'USE', color: '#93c47d' }],
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ import React from 'react';
|
||||
import { makeStyles, Theme } from '@material-ui/core';
|
||||
import { Ring } from '../../utils/types';
|
||||
|
||||
type Props = {
|
||||
export type Props = {
|
||||
radius: number;
|
||||
rings: Ring[];
|
||||
};
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import GetBBoxPolyfill from '../../utils/polyfills/getBBox';
|
||||
|
||||
import RadarLegend from './RadarLegend';
|
||||
import RadarLegend, { Props } from './RadarLegend';
|
||||
|
||||
const minProps = {
|
||||
const minProps: Props = {
|
||||
quadrants: [{ id: 'languages', name: 'Languages' }],
|
||||
rings: [{ id: 'use', name: 'USE', color: '#93c47d' }],
|
||||
entries: [
|
||||
|
||||
@@ -22,7 +22,7 @@ type Segments = {
|
||||
[k: number]: { [k: number]: Entry[] };
|
||||
};
|
||||
|
||||
type Props = {
|
||||
export type Props = {
|
||||
quadrants: Quadrant[];
|
||||
rings: Ring[];
|
||||
entries: Entry[];
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import GetBBoxPolyfill from '../../utils/polyfills/getBBox';
|
||||
|
||||
import RadarPlot from './RadarPlot';
|
||||
import RadarPlot, { Props } from './RadarPlot';
|
||||
|
||||
const minProps = {
|
||||
const minProps: Props = {
|
||||
width: 500,
|
||||
height: 200,
|
||||
radius: 50,
|
||||
|
||||
@@ -23,7 +23,7 @@ import RadarBubble from '../RadarBubble';
|
||||
import RadarFooter from '../RadarFooter';
|
||||
import RadarLegend from '../RadarLegend';
|
||||
|
||||
type Props = {
|
||||
export type Props = {
|
||||
width: number;
|
||||
height: number;
|
||||
radius: number;
|
||||
|
||||
@@ -61,7 +61,7 @@ export type Entry = {
|
||||
// An URL to a longer description as to why this entry is where it is
|
||||
url?: string;
|
||||
// How this entry has recently moved; -1 for "down", +1 for "up", 0 for not moved
|
||||
moved?: number;
|
||||
moved?: -1 | 0 | 1;
|
||||
active?: boolean;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user