Move charts* to ui.gadgets.charts* in the resource:extra root

char-rename
Alexander Iljin 2017-01-22 22:36:12 +03:00 committed by John Benediktsson
parent ecbb04d3fb
commit a050823f29
11 changed files with 29 additions and 29 deletions

View File

@ -1,4 +1,4 @@
! Copyright (C) 2017 Alexander Ilin. ! Copyright (C) 2017 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: tools.test charts ; USING: tools.test ui.gadgets.charts ;
IN: charts.tests IN: ui.gadgets.charts.tests

View File

@ -1,7 +1,7 @@
! Copyright (C) 2016-2017 Alexander Ilin. ! Copyright (C) 2016-2017 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel sequences ui.gadgets ; USING: accessors arrays kernel sequences ui.gadgets ;
IN: charts IN: ui.gadgets.charts
TUPLE: chart < gadget axes ; TUPLE: chart < gadget axes ;

View File

@ -1,9 +1,9 @@
! Copyright (C) 2017 Alexander Ilin. ! Copyright (C) 2017 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays charts charts.lines colors.constants USING: accessors arrays colors.constants kernel literals locals
kernel literals locals math math.constants math.functions math math.constants math.functions sequences ui ui.gadgets
sequences ui ui.gadgets ; ui.gadgets.charts ui.gadgets.charts.lines ;
IN: charts.demos IN: ui.gadgets.charts.demos
CONSTANT: -pi $[ pi neg ] CONSTANT: -pi $[ pi neg ]

View File

@ -1,14 +1,14 @@
! Copyright (C) 2017 Alexander Ilin. ! Copyright (C) 2017 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: binary-search charts charts.lines.private colors USING: binary-search colors help.markup help.syntax kernel
help.markup help.syntax kernel sequences splitting.monotonic sequences splitting.monotonic ui.gadgets ui.gadgets.charts
ui.gadgets ui.render ; ui.gadgets.charts.lines.private ui.render ;
IN: charts.lines IN: ui.gadgets.charts.lines
ABOUT: { "charts.lines" "about" } ABOUT: { "ui.gadgets.charts.lines" "about" }
ARTICLE: { "charts.lines" "about" } "Lines" ARTICLE: { "ui.gadgets.charts.lines" "about" } "Lines"
" The " { $vocab-link "charts.lines" } " vocab implements the " { $link line } " gadget. See the " { $link { "charts.lines" "implementation" } } "." ; " The " { $vocab-link "ui.gadgets.charts.lines" } " vocab implements the " { $link line } " gadget. See the " { $link { "charts.lines" "implementation" } } "." ;
ARTICLE: { "charts.lines" "implementation" } "Implementation details" ARTICLE: { "charts.lines" "implementation" } "Implementation details"
"The " { $slot "data" } " in a " { $link line } " gadget should be sorted by non-descending " { $snippet "x" } " coordinate. In a large data set this allows to quickly find the left and right intersection points with the viewport using binary " { $link search } " and remove the irrelevant data from further processing: " { $link clip-by-x } ". If the resulting sequence is empty (i.e. the entire data set is completely to the left or to the right of the viewport), nothing is drawn (" { $link x-in-bounds? } ")." "The " { $slot "data" } " in a " { $link line } " gadget should be sorted by non-descending " { $snippet "x" } " coordinate. In a large data set this allows to quickly find the left and right intersection points with the viewport using binary " { $link search } " and remove the irrelevant data from further processing: " { $link clip-by-x } ". If the resulting sequence is empty (i.e. the entire data set is completely to the left or to the right of the viewport), nothing is drawn (" { $link x-in-bounds? } ")."
@ -59,17 +59,17 @@ HELP: y-at
{ $description "Given two points on a straight line and an " { $snippet "x" } " coordinate, calculate the " { $snippet "y" } " coordinate at " { $snippet "x" } " on that line." } { $description "Given two points on a straight line and an " { $snippet "x" } " coordinate, calculate the " { $snippet "y" } " coordinate at " { $snippet "x" } " on that line." }
{ $examples { $examples
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"0 { 1 1 } { 5 5 } y-at ." "0 { 1 1 } { 5 5 } y-at ."
"0" "0"
} }
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"3 { 0 5 } { 5 5 } y-at ." "3 { 0 5 } { 5 5 } y-at ."
"5" "5"
} }
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"12 { 12 50 } { 15 15 } y-at ." "12 { 12 50 } { 15 15 } y-at ."
"50" "50"
} }
@ -79,12 +79,12 @@ HELP: calc-x
{ $description "Given the " { $snippet "slope" } " of a line and a random " { $snippet "point" } " belonging to that line, calculate the " { $snippet "x" } " coordinate corresponding to the given " { $snippet "y" } "." } { $description "Given the " { $snippet "slope" } " of a line and a random " { $snippet "point" } " belonging to that line, calculate the " { $snippet "x" } " coordinate corresponding to the given " { $snippet "y" } "." }
{ $examples { $examples
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"1 5 { 1 1 } calc-x ." "1 5 { 1 1 } calc-x ."
"5" "5"
} }
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"0.5 10 { 0 0 } calc-x ." "0.5 10 { 0 0 } calc-x ."
"20.0" "20.0"
} }
@ -94,12 +94,12 @@ HELP: calc-y
{ $description "Given the " { $snippet "slope" } " of a line and a random " { $snippet "point" } " belonging to that line, calculate the " { $snippet "y" } " coordinate corresponding to the given " { $snippet "x" } "." } { $description "Given the " { $snippet "slope" } " of a line and a random " { $snippet "point" } " belonging to that line, calculate the " { $snippet "y" } " coordinate corresponding to the given " { $snippet "x" } "." }
{ $examples { $examples
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"1 5 { 1 1 } calc-y ." "1 5 { 1 1 } calc-y ."
"5" "5"
} }
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"0.5 20 { 0 0 } calc-y ." "0.5 20 { 0 0 } calc-y ."
"10.0" "10.0"
} }
@ -111,12 +111,12 @@ $nl
"The formula for the calculation is " { $snippet "slope = (y1-y2) / (x1-x2)" } ", therefore it'll throw a division by zero error if both points have the same " { $snippet "x" } " coordinate." } "The formula for the calculation is " { $snippet "slope = (y1-y2) / (x1-x2)" } ", therefore it'll throw a division by zero error if both points have the same " { $snippet "x" } " coordinate." }
{ $examples { $examples
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"{ 1 1 } { 10 10 } calc-line-slope ." "{ 1 1 } { 10 10 } calc-line-slope ."
"1" "1"
} }
{ $example { $example
"USING: charts.lines.private prettyprint ;" "USING: ui.gadgets.charts.lines.private prettyprint ;"
"{ 0 0 } { 10 20 } calc-line-slope ." "{ 0 0 } { 10 20 } calc-line-slope ."
"2" "2"
} }

View File

@ -1,8 +1,8 @@
! Copyright (C) 2017 Alexander Ilin. ! Copyright (C) 2017 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel math sequences tools.test charts.lines USING: kernel math sequences tools.test
charts.lines.private ; ui.gadgets.charts.lines ui.gadgets.charts.lines.private ;
IN: charts.lines.tests IN: ui.gadgets.charts.lines.tests
{ -2/3 } [ { 1 3 } { -2 5 } calc-line-slope ] unit-test { -2/3 } [ { 1 3 } { -2 5 } calc-line-slope ] unit-test
{ 3 } [ -2/3 1 { 1 3 } calc-y ] unit-test { 3 } [ -2/3 1 { 1 3 } calc-y ] unit-test

View File

@ -1,11 +1,11 @@
! Copyright (C) 2016-2017 Alexander Ilin. ! Copyright (C) 2016-2017 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs binary-search charts combinators USING: accessors arrays assocs binary-search combinators
combinators.short-circuit fry kernel locals make math math.order combinators.short-circuit fry kernel locals make math math.order
math.statistics math.vectors namespaces opengl opengl.gl math.statistics math.vectors namespaces opengl opengl.gl
sequences specialized-arrays.instances.alien.c-types.float sequences specialized-arrays.instances.alien.c-types.float
splitting.monotonic ui.gadgets ui.render ; splitting.monotonic ui.gadgets ui.gadgets.charts ui.render ;
IN: charts.lines IN: ui.gadgets.charts.lines
! Data must be a sequence of { x y } coordinates sorted by ! Data must be a sequence of { x y } coordinates sorted by
! non-descending x vaues. ! non-descending x vaues.