Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename symbolX to symbolTimes, alias as symbolX #192

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

@@ -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.

2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -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";
4 changes: 2 additions & 2 deletions src/symbol.js
Original file line number Diff line number Diff line change
@@ -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 = [
@@ -29,7 +29,7 @@ export const symbolsFill = [
export const symbolsStroke = [
circle,
plus,
x,
times,
triangle2,
asterisk,
square2,
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";

@@ -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");
});
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);
@@ -21,7 +21,7 @@ it("symbolsStroke is the array of symbol types", () => {
assert.deepStrictEqual(symbolsStroke, [
symbolCircle,
symbolPlus,
symbolX,
symbolTimes,
symbolTriangle2,
symbolAsterisk,
symbolSquare2,