Skip to content

Commit

Permalink
rename symbolX to symbolTimes, alias as symbolX (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil authored Dec 20, 2022
1 parent c95704e commit 77fce6d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ An array containing a set of symbol types designed for filling: [circle](#symbol

<a name="symbolsStroke" href="#symbolsStroke">#</a> d3.<b>symbolsStroke</b> · [Source](https://github.com/d3/d3-shape/blob/main/src/symbol.js)

An array containing a set of symbol types designed for stroking: [circle](#symbolCircle), [plus](#symbolPlus), [x](#symbolX), [triangle2](#symbolTriangle2), [asterisk](#symbolAsterisk), [square2](#symbolSquare2), and [diamond2](#symbolDiamond2). Useful for constructing the range of an [ordinal scale](https://github.com/d3/d3-scale#ordinal-scales) should you wish to use a shape encoding for categorical data.
An array containing a set of symbol types designed for stroking: [circle](#symbolCircle), [plus](#symbolPlus), [times](#symbolTimes), [triangle2](#symbolTriangle2), [asterisk](#symbolAsterisk), [square2](#symbolSquare2), and [diamond2](#symbolDiamond2). Useful for constructing the range of an [ordinal scale](https://github.com/d3/d3-scale#ordinal-scales) should you wish to use a shape encoding for categorical data.

<a name="symbolAsterisk" href="#symbolAsterisk">#</a> d3.<b>symbolAsterisk</b> · [Source](https://github.com/d3/d3-shape/blob/main/src/symbol/asterisk.js)

Expand Down Expand Up @@ -1023,7 +1023,7 @@ The up-pointing triangle symbol type; intended for stroking.

The Y-shape symbol type; intended for filling.

<a name="symbolX" href="#symbolX">#</a> d3.<b>symbolX</b> · [Source](https://github.com/d3/d3-shape/blob/main/src/symbol/x.js)
<a name="symbolTimes" href="#symbolTimes">#</a> d3.<b>symbolTimes</b> · [Source](https://github.com/d3/d3-shape/blob/main/src/symbol/times.js)

The X-shape symbol type; intended for stroking.

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export {default as symbolStar} from "./symbol/star.js";
export {default as symbolTriangle} from "./symbol/triangle.js";
export {default as symbolTriangle2} from "./symbol/triangle2.js";
export {default as symbolWye} from "./symbol/wye.js";
export {default as symbolX} from "./symbol/x.js";
export {default as symbolTimes, default as symbolX} from "./symbol/times.js";

export {default as curveBasisClosed} from "./curve/basisClosed.js";
export {default as curveBasisOpen} from "./curve/basisOpen.js";
Expand Down
4 changes: 2 additions & 2 deletions src/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import star from "./symbol/star.js";
import triangle from "./symbol/triangle.js";
import triangle2 from "./symbol/triangle2.js";
import wye from "./symbol/wye.js";
import x from "./symbol/x.js";
import times from "./symbol/times.js";

// These symbols are designed to be filled.
export const symbolsFill = [
Expand All @@ -29,7 +29,7 @@ export const symbolsFill = [
export const symbolsStroke = [
circle,
plus,
x,
times,
triangle2,
asterisk,
square2,
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions test/symbol-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import {symbol, symbolAsterisk, symbolCircle, symbolCross, symbolDiamond, symbolDiamond2, symbolPlus, symbolSquare, symbolSquare2, symbolStar, symbolTriangle, symbolTriangle2, symbolWye, symbolX} from "../src/index.js";
import {symbol, symbolAsterisk, symbolCircle, symbolCross, symbolDiamond, symbolDiamond2, symbolPlus, symbolSquare, symbolSquare2, symbolStar, symbolTriangle, symbolTriangle2, symbolWye, symbolTimes} from "../src/index.js";
import {assertInDelta, assertPathEqual} from "./asserts.js";
import {polygonContext} from "./polygonContext.js";

Expand Down Expand Up @@ -153,8 +153,8 @@ it("symbol.type(symbolWye) generates the expected path", () => {
assertPathEqual(s(10), "M0.853360,0.492688L0.853360,2.199408L-0.853360,2.199408L-0.853360,0.492688L-2.331423,-0.360672L-1.478063,-1.838735L0,-0.985375L1.478063,-1.838735L2.331423,-0.360672Z");
});

it("symbol.type(symbolX) generates the expected path", () => {
const s = symbol().type(symbolX).size(function(d) { return d; });
it("symbol.type(symbolTimes) generates the expected path", () => {
const s = symbol().type(symbolTimes).size(function(d) { return d; });
assertPathEqual(s(0), "M0,0L0,0M0,0L0,0");
assertPathEqual(s(20), "M-2.647561,-2.647561L2.647561,2.647561M-2.647561,2.647561L2.647561,-2.647561");
});
Expand Down
4 changes: 2 additions & 2 deletions test/symbols-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import {symbols, symbolsFill, symbolsStroke, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye, symbolPlus, symbolX, symbolTriangle2, symbolAsterisk, symbolSquare2, symbolDiamond2} from "../src/index.js";
import {symbols, symbolsFill, symbolsStroke, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye, symbolPlus, symbolTimes, symbolTriangle2, symbolAsterisk, symbolSquare2, symbolDiamond2} from "../src/index.js";

it("symbols is a deprecated alias for symbolsFill", () => {
assert.strictEqual(symbols, symbolsFill);
Expand All @@ -21,7 +21,7 @@ it("symbolsStroke is the array of symbol types", () => {
assert.deepStrictEqual(symbolsStroke, [
symbolCircle,
symbolPlus,
symbolX,
symbolTimes,
symbolTriangle2,
symbolAsterisk,
symbolSquare2,
Expand Down

0 comments on commit 77fce6d

Please sign in to comment.