This reverts commit 1e78437f71
.
This commit is contained in:
parent
1e78437f71
commit
6a9be3b7f4
|
@ -23,8 +23,6 @@ export const fallbackEdgeType: EdgeType = Object.freeze({
|
|||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1,
|
||||
prefix: EdgeAddress.empty,
|
||||
description:
|
||||
"The fallback EdgeType for edges which don't have any other type",
|
||||
});
|
||||
|
||||
export const fallbackDeclaration: PluginDeclaration = Object.freeze({
|
||||
|
|
|
@ -96,7 +96,4 @@ export type EdgeType = {|
|
|||
// of this EdgeType. A given edge `e` is a member of the type `t` if
|
||||
// `EdgeAddress.hasPrefix(e.address, t.prefix) == true`
|
||||
+prefix: EdgeAddressT,
|
||||
// The `description` property should be a human-readable string that makes
|
||||
// it clear to a user what each EdgeType does
|
||||
+description: string,
|
||||
|};
|
||||
|
|
|
@ -157,7 +157,6 @@ describe("explorer/pagerankTable/Aggregation", () => {
|
|||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1,
|
||||
prefix: EdgeAddress.fromParts(["look", "like"]),
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
};
|
||||
function aggView(aggregation: FlatAggregation) {
|
||||
const el = shallow(<AggregationView aggregation={aggregation} />);
|
||||
|
|
|
@ -66,7 +66,6 @@ describe("explorer/pagerankTable/aggregate", () => {
|
|||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1,
|
||||
prefix: EdgeAddress.fromParts(["foo"]),
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
},
|
||||
bar: {
|
||||
forwardName: "bars",
|
||||
|
@ -74,7 +73,6 @@ describe("explorer/pagerankTable/aggregate", () => {
|
|||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1,
|
||||
prefix: EdgeAddress.fromParts(["bar"]),
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
},
|
||||
empty: {
|
||||
forwardName: "empty",
|
||||
|
@ -82,7 +80,6 @@ describe("explorer/pagerankTable/aggregate", () => {
|
|||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1,
|
||||
prefix: EdgeAddress.empty,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
},
|
||||
};
|
||||
const edgeTypesArray = [edgeTypes.foo, edgeTypes.bar];
|
||||
|
|
|
@ -15,7 +15,6 @@ export class EdgeTypeConfig extends React.Component<{
|
|||
<EdgeWeightSlider
|
||||
name={this.props.weightedType.type.backwardName}
|
||||
weight={this.props.weightedType.forwardWeight}
|
||||
description={this.props.weightedType.type.description}
|
||||
onChange={(forwardWeight) => {
|
||||
this.props.onChange({
|
||||
...this.props.weightedType,
|
||||
|
@ -26,7 +25,6 @@ export class EdgeTypeConfig extends React.Component<{
|
|||
<EdgeWeightSlider
|
||||
name={this.props.weightedType.type.forwardName}
|
||||
weight={this.props.weightedType.backwardWeight}
|
||||
description={this.props.weightedType.type.description}
|
||||
onChange={(backwardWeight) => {
|
||||
this.props.onChange({
|
||||
...this.props.weightedType,
|
||||
|
@ -59,7 +57,6 @@ export class EdgeWeightSlider extends React.Component<WeightSliderProps> {
|
|||
<WeightSlider
|
||||
name={modifiedName}
|
||||
weight={this.props.weight}
|
||||
description={this.props.description}
|
||||
onChange={this.props.onChange}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -54,12 +54,7 @@ describe("explorer/weights/EdgeTypeConfig", () => {
|
|||
function example() {
|
||||
const onChange = jest.fn();
|
||||
const element = shallow(
|
||||
<EdgeWeightSlider
|
||||
weight={3}
|
||||
name="foo"
|
||||
description="Description for test slider"
|
||||
onChange={onChange}
|
||||
/>
|
||||
<EdgeWeightSlider weight={3} name="foo" onChange={onChange} />
|
||||
);
|
||||
const weightSlider = element.find(WeightSlider);
|
||||
return {element, onChange, weightSlider};
|
||||
|
|
|
@ -13,7 +13,6 @@ export class NodeTypeConfig extends React.Component<{
|
|||
<WeightSlider
|
||||
name={this.props.weightedType.type.name}
|
||||
weight={this.props.weightedType.weight}
|
||||
description={this.props.weightedType.type.description}
|
||||
onChange={(weight) => {
|
||||
this.props.onChange({
|
||||
...this.props.weightedType,
|
||||
|
|
|
@ -6,12 +6,11 @@ export type Props = {|
|
|||
+weight: number,
|
||||
+name: React$Node,
|
||||
+onChange: (number) => void,
|
||||
+description: string,
|
||||
|};
|
||||
export class WeightSlider extends React.Component<Props> {
|
||||
render() {
|
||||
return (
|
||||
<label style={{display: "flex"}} title={this.props.description}>
|
||||
<label style={{display: "flex"}}>
|
||||
<span style={{flexGrow: 1}}>{this.props.name}</span>
|
||||
<input
|
||||
type="range"
|
||||
|
|
|
@ -12,12 +12,7 @@ describe("explorer/weights/WeightSlider", () => {
|
|||
function example() {
|
||||
const onChange = jest.fn();
|
||||
const element = shallow(
|
||||
<WeightSlider
|
||||
weight={3}
|
||||
name="foo"
|
||||
description="Description for test slider"
|
||||
onChange={onChange}
|
||||
/>
|
||||
<WeightSlider weight={3} name="foo" onChange={onChange} />
|
||||
);
|
||||
return {element, onChange};
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ export const assemblesEdgeType: EdgeType = Object.freeze({
|
|||
backwardName: "is assembled by",
|
||||
defaultBackwardWeight: 2 ** -2,
|
||||
prefix: EdgeAddress.fromParts(["factorio", "assembles"]),
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
export const transportsEdgeType: EdgeType = Object.freeze({
|
||||
|
@ -37,7 +36,6 @@ export const transportsEdgeType: EdgeType = Object.freeze({
|
|||
backwardName: "is transported by",
|
||||
defaultBackwardWeight: 2 ** -1,
|
||||
prefix: EdgeAddress.fromParts(["factorio", "transports"]),
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
export const declaration: PluginDeclaration = Object.freeze({
|
||||
|
|
|
@ -19,7 +19,6 @@ const hasParentEdgeType = Object.freeze({
|
|||
prefix: E.Prefix.hasParent,
|
||||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const nodeTypes = Object.freeze([commitNodeType]);
|
||||
|
|
|
@ -76,7 +76,6 @@ const authorsEdgeType = Object.freeze({
|
|||
defaultForwardWeight: 1 / 2,
|
||||
defaultBackwardWeight: 1,
|
||||
prefix: E.Prefix.authors,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const hasParentEdgeType = Object.freeze({
|
||||
|
@ -85,7 +84,6 @@ const hasParentEdgeType = Object.freeze({
|
|||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1 / 4,
|
||||
prefix: E.Prefix.hasParent,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const mergedAsEdgeType = Object.freeze({
|
||||
|
@ -94,7 +92,6 @@ const mergedAsEdgeType = Object.freeze({
|
|||
defaultForwardWeight: 1 / 2,
|
||||
defaultBackwardWeight: 1,
|
||||
prefix: E.Prefix.mergedAs,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const referencesEdgeType = Object.freeze({
|
||||
|
@ -103,7 +100,6 @@ const referencesEdgeType = Object.freeze({
|
|||
defaultForwardWeight: 1,
|
||||
defaultBackwardWeight: 1 / 16,
|
||||
prefix: E.Prefix.references,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const mentionsAuthorEdgeType = Object.freeze({
|
||||
|
@ -113,7 +109,6 @@ const mentionsAuthorEdgeType = Object.freeze({
|
|||
// TODO(#811): Probably change this to 0
|
||||
defaultBackwardWeight: 1 / 32,
|
||||
prefix: E.Prefix.mentionsAuthor,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const reactsHeartEdgeType = Object.freeze({
|
||||
|
@ -123,7 +118,6 @@ const reactsHeartEdgeType = Object.freeze({
|
|||
// TODO(#811): Probably change this to 0
|
||||
defaultBackwardWeight: 1 / 32,
|
||||
prefix: E.Prefix.reactsHeart,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const reactsThumbsUpEdgeType = Object.freeze({
|
||||
|
@ -133,7 +127,6 @@ const reactsThumbsUpEdgeType = Object.freeze({
|
|||
// TODO(#811): Probably change this to 0
|
||||
defaultBackwardWeight: 1 / 32,
|
||||
prefix: E.Prefix.reactsThumbsUp,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const reactsHoorayEdgeType = Object.freeze({
|
||||
|
@ -143,7 +136,6 @@ const reactsHoorayEdgeType = Object.freeze({
|
|||
// TODO(#811): Probably change this to 0
|
||||
defaultBackwardWeight: 1 / 32,
|
||||
prefix: E.Prefix.reactsHooray,
|
||||
description: "TODO: Add a description for this EdgeType",
|
||||
});
|
||||
|
||||
const reactsRocketEdgeType = Object.freeze({
|
||||
|
|
Loading…
Reference in New Issue