🚧 Work on examples
This commit is contained in:
parent
284fd9c17d
commit
03d0cc4977
2 changed files with 17 additions and 13 deletions
|
@ -71,6 +71,7 @@
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist/*",
|
"dist/*",
|
||||||
|
"scr/*",
|
||||||
"README.md",
|
"README.md",
|
||||||
"package.json"
|
"package.json"
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
export default part => {
|
export default part => {
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths, options } = part.shorthand();
|
||||||
|
|
||||||
|
const textClasses = label =>
|
||||||
|
options.focus === label ? "center text-xs fill-note" : "center text-xs";
|
||||||
|
|
||||||
points.A = new Point(10, 10)
|
points.A = new Point(10, 10)
|
||||||
.attr("data-text", "msg_move")
|
.attr("data-text", "Path.move()")
|
||||||
.attr("data-text-class", "center text-xs");
|
.attr("data-text-class", textClasses("move"));
|
||||||
points.B = new Point(70, 30);
|
points.B = new Point(70, 30);
|
||||||
points.BCp2 = new Point(40, 10);
|
points.BCp2 = new Point(40, 10);
|
||||||
points.C = new Point(90, -50);
|
points.C = new Point(90, -50);
|
||||||
|
@ -16,32 +19,32 @@ export default part => {
|
||||||
paths.line = new Path()
|
paths.line = new Path()
|
||||||
.move(points.A)
|
.move(points.A)
|
||||||
.line(points.B)
|
.line(points.B)
|
||||||
.attr("data-text", "msg_line")
|
.attr("data-text", "Path.line()")
|
||||||
.attr("data-text-class", "center text-xs");
|
.attr("data-text-class", textClasses("line"));
|
||||||
|
|
||||||
paths.curve = new Path()
|
paths.curve = new Path()
|
||||||
.move(points.B)
|
.move(points.B)
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
.curve(points.BCp2, points.CCp1, points.C)
|
||||||
.attr("data-text", "msg_curve")
|
.attr("data-text", "Path.curve()")
|
||||||
.attr("data-text-class", "center text-xs");
|
.attr("data-text-class", textClasses("curve"));
|
||||||
|
|
||||||
paths._curve = new Path()
|
paths._curve = new Path()
|
||||||
.move(points.C)
|
.move(points.C)
|
||||||
._curve(points.DCp, points.D)
|
._curve(points.DCp, points.D)
|
||||||
.attr("data-text", "msg__curve")
|
.attr("data-text", "Path._curve()")
|
||||||
.attr("data-text-class", "center text-xs");
|
.attr("data-text-class", textClasses("_curve"));
|
||||||
|
|
||||||
paths.curve_ = new Path()
|
paths.curve_ = new Path()
|
||||||
.move(points.D)
|
.move(points.D)
|
||||||
.curve_(points.ECp, points.E)
|
.curve_(points.ECp, points.E)
|
||||||
.attr("data-text", "msg_curve_")
|
.attr("data-text", "Path.curve_()")
|
||||||
.attr("data-text-class", "center text-xs");
|
.attr("data-text-class", textClasses("curve_"));
|
||||||
|
|
||||||
paths.close = new Path()
|
paths.close = new Path()
|
||||||
.move(points.E)
|
.move(points.E)
|
||||||
.line(points.A)
|
.line(points.A)
|
||||||
.attr("data-text", "msg_close")
|
.attr("data-text", "Path.close()")
|
||||||
.attr("data-text-class", "center text-xs");
|
.attr("data-text-class", textClasses("close"));
|
||||||
|
|
||||||
paths.example = paths.line
|
paths.example = paths.line
|
||||||
.join(paths.curve)
|
.join(paths.curve)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue