-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* preattentive symbols Symbols with preattentive features aid pattern detection and reduce overlap. This symbol set implements ideas of Cleveland, Wilkinson, and others, and has been tested for popularity and discriminability, and adjusted for approximately equal weight. Many products support up to a dozen different symbol sets. This is analogous to multiple color schemes, such as Dr. Cindy Brewer's recently supported in d3. Not knowing d3's plans for symbol sets, I've only made a bare attempt at integrating these, but would be happy to continue this work along whatever lines are appropriate. * export new symbols * add tests for new symbols * PreTieR * Update README * Update README.md Co-authored-by: Philippe Rivière <fil@rezo.net> * Update README.md Co-authored-by: Philippe Rivière <fil@rezo.net> Co-authored-by: Heman Robinson <heman.robinson@gmail.com> Co-authored-by: Philippe Rivière <fil@rezo.net>
- Loading branch information
1 parent
67436be
commit 1bf1f67
Showing
19 changed files
with
273 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {min, sqrt} from "../math.js"; | ||
|
||
const sqrt3 = sqrt(3); | ||
|
||
export default { | ||
draw(context, size) { | ||
const r = sqrt(size + min(size / 28, 0.75)) * 0.59436; | ||
const t = r / 2; | ||
const u = t * sqrt3; | ||
context.moveTo(0, r); | ||
context.lineTo(0, -r); | ||
context.moveTo(-u, -t); | ||
context.lineTo(u, t); | ||
context.moveTo(-u, t); | ||
context.lineTo(u, -t); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {sqrt} from "../math.js"; | ||
|
||
export default { | ||
draw(context, size) { | ||
const r = sqrt(size) * 0.62625; | ||
context.moveTo(0, -r); | ||
context.lineTo(r, 0); | ||
context.lineTo(0, r); | ||
context.lineTo(-r, 0); | ||
context.closePath(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {min, sqrt} from "../math.js"; | ||
|
||
export default { | ||
draw(context, size) { | ||
const r = sqrt(size - min(size / 7, 2)) * 0.87559; | ||
context.moveTo(-r, 0); | ||
context.lineTo(r, 0); | ||
context.moveTo(0, r); | ||
context.lineTo(0, -r); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import {sqrt} from "../math.js"; | ||
|
||
export default { | ||
draw: function(context, size) { | ||
var w = Math.sqrt(size), | ||
x = -w / 2; | ||
draw(context, size) { | ||
const w = sqrt(size); | ||
const x = -w / 2; | ||
context.rect(x, x, w, w); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {sqrt} from "../math.js"; | ||
|
||
export default { | ||
draw(context, size) { | ||
const r = sqrt(size) * 0.4431; | ||
context.moveTo(r, r); | ||
context.lineTo(r, -r); | ||
context.lineTo(-r, -r); | ||
context.lineTo(-r, r); | ||
context.closePath(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {sqrt} from "../math.js"; | ||
|
||
const sqrt3 = sqrt(3); | ||
|
||
export default { | ||
draw(context, size) { | ||
const s = sqrt(size) * 0.6824; | ||
const t = s / 2; | ||
const u = (s * sqrt3) / 2; // cos(Math.PI / 6) | ||
context.moveTo(0, -s); | ||
context.lineTo(u, t); | ||
context.lineTo(-u, t); | ||
context.closePath(); | ||
} | ||
}; |
Oops, something went wrong.