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