diff --git a/doc/examples/charts-basic/custom_font.clp b/doc/examples/charts-basic/custom_font.clp index b8e13f66a..518917d32 100644 --- a/doc/examples/charts-basic/custom_font.clp +++ b/doc/examples/charts-basic/custom_font.clp @@ -1,30 +1,24 @@ -(width 2048px) -(height 512px) -(dpi 240) +(layer/resize 2048px 512px) +(layer/set-dpi 240) +(layer/set-font "Comic Sans MS") -(font "Comic Sans MS") -(limit-x (1404278100 1404299700)) -(limit-y (0 120)) - -(axes - position (bottom left) - label-format-y (fixed 2) - label-format-x (datetime "%H:%M:%S") - label-placement-x (linear 2400) - label-placement-y (linear 20)) - -;; (draw/rectangle fill #f2f2f2) - -(grid - color #fff) - -(lines - data-x (csv "test/testdata/measurement.csv" time) - data-y (csv "test/testdata/measurement.csv" value2)) - -(legend - position (top right) - border none - margin 0.5em - item-flow on - item (label "A very serious measurement")) +(tools/plotgen + limit-x (1404278100 1404299700) + limit-y (0 120) + grid ( + color #fff) + axes ( + position (bottom left) + label-format-y (fixed 2) + label-format-x (datetime "%H:%M:%S") + label-placement-x (linear 2400) + label-placement-y (linear 20)) + lines ( + data-x (csv "test/testdata/measurement.csv" time) + data-y (csv "test/testdata/measurement.csv" value2)) + legend ( + position (top right) + border none + margin 0.5em + item-flow on + item (label "A very serious measurement"))) diff --git a/doc/examples/charts-basic/custom_font.svg b/doc/examples/charts-basic/custom_font.svg index dcd395b48..60a388ddb 100644 --- a/doc/examples/charts-basic/custom_font.svg +++ b/doc/examples/charts-basic/custom_font.svg @@ -2,6 +2,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -137,28 +159,6 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/examples/charts-custom/custom_color_palette.clp b/doc/examples/charts-custom/custom_color_palette.clp index c9f8d42b5..6731e4ec5 100644 --- a/doc/examples/charts-custom/custom_color_palette.clp +++ b/doc/examples/charts-custom/custom_color_palette.clp @@ -1,15 +1,15 @@ -(width 2048px) -(height 1024px) -(dpi 240) +(layer/resize 2048px 1024px) +(layer/set-dpi 240) ;;(set color-palette (#0c0 #c00 #00c)) -(legend - item (label "Test Color 1" color 1) - item (label "Test Color 2" color 2) - item (label "Test Color 3" color 3) - item (label "Test Color 4" color 4) - item (label "Test Color 5" color 5) - item (label "Test Color 6" color 6) - item (label "Test Color 7" color 7) - item (label "Test Color 8" color 8)) +(tools/plotgen + legend ( + item (label "Test Color 1" color 1) + item (label "Test Color 2" color 2) + item (label "Test Color 3" color 3) + item (label "Test Color 4" color 4) + item (label "Test Color 5" color 5) + item (label "Test Color 6" color 6) + item (label "Test Color 7" color 7) + item (label "Test Color 8" color 8))) diff --git a/doc/examples/charts-custom/text_i18n.clp b/doc/examples/charts-custom/text_i18n.clp index 2f94ff8a8..498ede2a8 100644 --- a/doc/examples/charts-custom/text_i18n.clp +++ b/doc/examples/charts-custom/text_i18n.clp @@ -1,16 +1,13 @@ -(dpi 400) -(width 3600px) -(height 1920px) - -;;(set text-script "Arabic") - -(legend - border none - margin 0 - item (label "北京市 (Beijing)" color #06c) - item (label "תל אביב (Tel Aviv)" color #c06) - item (label "القاهرة‎ (Cairo)" color #c06) - item (label "Москва" color #60c) - item (label "東京都 (Tokyo)" color #6c0) - item (label "서울 (Seoul)")) +(layer/resize 3600px 1920px) +(layer/set-dpi 400) +(tools/plotgen + legend ( + border none + margin 0 + item (label "北京市 (Beijing)" color #06c) + item (label "תל אביב (Tel Aviv)" color #c06) + item (label "القاهرة‎ (Cairo)" color #c06) + item (label "Москва" color #60c) + item (label "東京都 (Tokyo)" color #6c0) + item (label "서울 (Seoul)"))) diff --git a/doc/examples/charts-editorial/stacked_areas.clp b/doc/examples/charts-editorial/stacked_areas.clp index 2866c9254..7fd0434d7 100644 --- a/doc/examples/charts-editorial/stacked_areas.clp +++ b/doc/examples/charts-editorial/stacked_areas.clp @@ -1,67 +1,57 @@ -(width 1600px) -(height 800px) -(dpi 240) - -;;(set color-palette zhang) - -(limit-x (0 100)) -(limit-y (0 90)) - -(axes - position (bottom left) - label-placement-y (linear-interval 10 10 80) - border-style-left none - label-offset-left 0 - label-attach-left left - label-color-left #666) - -(grid - tick-placement-x (none) - tick-placement-y (linear-interval 10 10 80) - color (rgba 0 0 0 .1)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (7 13 17 27 38 39 52 59 48 60 65) - color 5 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (4 12 15 22 35 38 47 47 42 53 60) - color 4 - stroke-width .6pt - stroke-color (rgba 0 0 0 .4)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (3 10 10 18 32 34 42 40 36 46 54) - color 3 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (2 6 6 8 18 20 30 30 30 36 35) - color 2 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (1 2 4 7 13 15 20 16 18 23 18) - color 1 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(legend - position (top right) - margin 0 - padding 0 - item-flow on - item (label "Series A" color 1) - item (label "Series B" color 2) - item (label "Series C" color 3) - item (label "Series D" color 4) - item (label "Series E" color 5)) +(layer/resize 1600px 800px) +(layer/set-dpi 240) + +(tools/plotgen + limit-x (0 100) + limit-y (0 90) + axes ( + position (bottom left) + label-placement-y (linear-interval 10 10 80) + border-style-left none + label-offset-left 0 + label-attach-left left + label-color-left #666) + grid ( + tick-placement-x (none) + tick-placement-y (linear-interval 10 10 80) + color (rgba 0 0 0 0.1)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (7 13 17 27 38 39 52 59 48 60 65) + color 5 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (4 12 15 22 35 38 47 47 42 53 60) + color 4 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.4)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (3 10 10 18 32 34 42 40 36 46 54) + color 3 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (2 6 6 8 18 20 30 30 30 36 35) + color 2 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (1 2 4 7 13 15 20 16 18 23 18) + color 1 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + legend ( + position (top right) + margin 0 + padding 0 + item-flow on + item (label "Series A" color 1) + item (label "Series B" color 2) + item (label "Series C" color 3) + item (label "Series D" color 4) + item (label "Series E" color 5))) diff --git a/doc/examples/charts-scientific/scalarfield.svg b/doc/examples/charts-scientific/scalarfield.svg index 197dfe60e..928f7c75a 100644 --- a/doc/examples/charts-scientific/scalarfield.svg +++ b/doc/examples/charts-scientific/scalarfield.svg @@ -274,4004 +274,4004 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/examples/maps/gulf-of-mexico.clp b/doc/examples/maps/gulf-of-mexico.clp index a646e677a..1e7ff7289 100644 --- a/doc/examples/maps/gulf-of-mexico.clp +++ b/doc/examples/maps/gulf-of-mexico.clp @@ -9,7 +9,7 @@ label-placement-y (linear 1) title-bottom "Longitude" title-left "Lattitude") - background fill + background (fill #eff7fe) grid ( tick-placement-x (linear 5) tick-placement-y (linear 5) diff --git a/doc/examples/maps/gulf-of-mexico.svg b/doc/examples/maps/gulf-of-mexico.svg index a0e480dcc..e2e3fdcee 100644 --- a/doc/examples/maps/gulf-of-mexico.svg +++ b/doc/examples/maps/gulf-of-mexico.svg @@ -106,80 +106,80 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gulf of Mexico + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gulf of Mexico \ No newline at end of file diff --git a/doc/examples/maps/submarine-cables.clp b/doc/examples/maps/submarine-cables.clp deleted file mode 100644 index facc7778d..000000000 --- a/doc/examples/maps/submarine-cables.clp +++ /dev/null @@ -1,31 +0,0 @@ -(width 2048px) -(height 1200px) -(dpi 220) - -(default limit-x (-180 180)) -(default limit-y (-80 100)) - -(draw/rectangle - fill #f9f9f9) - -(plot/grid - tick-placement-x (linear 10) - tick-placement-y (none) - color (rgba 0 0 0 .1) - stroke-style (dashed) - stroke-width .5pt) - -(plot/lines - data (geojson /home/paul/downloads/mapex/submarine_cables.geojson) - stroke-color #666 - stroke-width .5pt) - -(plot/polygons - data (geojson /home/paul/downloads/mapex/world.geojson) - fill #e8e8e8 - stroke-color #bbb - stroke-width .2pt) - -(figure/legend - item (label "Submarine cables")) - diff --git a/src/layer.cc b/src/layer.cc index 3443b5cb9..d836fa0b4 100644 --- a/src/layer.cc +++ b/src/layer.cc @@ -151,17 +151,18 @@ void layer_set_font( ReturnCode layer_set_font( Context* ctx, const Expr* expr) { + auto layer = layer_get(ctx); + auto args = expr_collect(expr); if (args.size() != 1) { return err_invalid_nargs(args.size(), 1); } FontInfo font; - if (auto rc = expr_call_string(args[0], bind(&font_load_best, _1, &font)); !rc) { + if (auto rc = expr_call_string(args[0], bind(&font_load_best, _1, &layer->font)); !rc) { return rc; } - layer_set_font(layer_get(ctx), std::move(font)); return OK; } diff --git a/src/plot/plotgen.cc b/src/plot/plotgen.cc index 78dc06b24..31c66a343 100644 --- a/src/plot/plotgen.cc +++ b/src/plot/plotgen.cc @@ -115,7 +115,7 @@ ReturnCode plot_set_background( stroke_style.line_width = from_pt(1); /* read arguments */ - auto config_rc = expr_walk_map(expr, { + auto config_rc = expr_walk_map_wrapped(expr, { { "color", expr_calln_fn({ diff --git a/test/examples/charts_basic_custom_font.clp b/test/examples/charts_basic_custom_font.clp index b8e13f66a..518917d32 100644 --- a/test/examples/charts_basic_custom_font.clp +++ b/test/examples/charts_basic_custom_font.clp @@ -1,30 +1,24 @@ -(width 2048px) -(height 512px) -(dpi 240) +(layer/resize 2048px 512px) +(layer/set-dpi 240) +(layer/set-font "Comic Sans MS") -(font "Comic Sans MS") -(limit-x (1404278100 1404299700)) -(limit-y (0 120)) - -(axes - position (bottom left) - label-format-y (fixed 2) - label-format-x (datetime "%H:%M:%S") - label-placement-x (linear 2400) - label-placement-y (linear 20)) - -;; (draw/rectangle fill #f2f2f2) - -(grid - color #fff) - -(lines - data-x (csv "test/testdata/measurement.csv" time) - data-y (csv "test/testdata/measurement.csv" value2)) - -(legend - position (top right) - border none - margin 0.5em - item-flow on - item (label "A very serious measurement")) +(tools/plotgen + limit-x (1404278100 1404299700) + limit-y (0 120) + grid ( + color #fff) + axes ( + position (bottom left) + label-format-y (fixed 2) + label-format-x (datetime "%H:%M:%S") + label-placement-x (linear 2400) + label-placement-y (linear 20)) + lines ( + data-x (csv "test/testdata/measurement.csv" time) + data-y (csv "test/testdata/measurement.csv" value2)) + legend ( + position (top right) + border none + margin 0.5em + item-flow on + item (label "A very serious measurement"))) diff --git a/test/examples/charts_basic_custom_font.svg b/test/examples/charts_basic_custom_font.svg index 81252aec1..60a388ddb 100644 --- a/test/examples/charts_basic_custom_font.svg +++ b/test/examples/charts_basic_custom_font.svg @@ -2,17 +2,38 @@ + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + @@ -22,78 +43,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/examples/charts_custom_custom_color_palette.clp b/test/examples/charts_custom_custom_color_palette.clp index c9f8d42b5..6731e4ec5 100644 --- a/test/examples/charts_custom_custom_color_palette.clp +++ b/test/examples/charts_custom_custom_color_palette.clp @@ -1,15 +1,15 @@ -(width 2048px) -(height 1024px) -(dpi 240) +(layer/resize 2048px 1024px) +(layer/set-dpi 240) ;;(set color-palette (#0c0 #c00 #00c)) -(legend - item (label "Test Color 1" color 1) - item (label "Test Color 2" color 2) - item (label "Test Color 3" color 3) - item (label "Test Color 4" color 4) - item (label "Test Color 5" color 5) - item (label "Test Color 6" color 6) - item (label "Test Color 7" color 7) - item (label "Test Color 8" color 8)) +(tools/plotgen + legend ( + item (label "Test Color 1" color 1) + item (label "Test Color 2" color 2) + item (label "Test Color 3" color 3) + item (label "Test Color 4" color 4) + item (label "Test Color 5" color 5) + item (label "Test Color 6" color 6) + item (label "Test Color 7" color 7) + item (label "Test Color 8" color 8))) diff --git a/test/examples/charts_custom_text_i18n.clp b/test/examples/charts_custom_text_i18n.clp index 2f94ff8a8..498ede2a8 100644 --- a/test/examples/charts_custom_text_i18n.clp +++ b/test/examples/charts_custom_text_i18n.clp @@ -1,16 +1,13 @@ -(dpi 400) -(width 3600px) -(height 1920px) - -;;(set text-script "Arabic") - -(legend - border none - margin 0 - item (label "北京市 (Beijing)" color #06c) - item (label "תל אביב (Tel Aviv)" color #c06) - item (label "القاهرة‎ (Cairo)" color #c06) - item (label "Москва" color #60c) - item (label "東京都 (Tokyo)" color #6c0) - item (label "서울 (Seoul)")) +(layer/resize 3600px 1920px) +(layer/set-dpi 400) +(tools/plotgen + legend ( + border none + margin 0 + item (label "北京市 (Beijing)" color #06c) + item (label "תל אביב (Tel Aviv)" color #c06) + item (label "القاهرة‎ (Cairo)" color #c06) + item (label "Москва" color #60c) + item (label "東京都 (Tokyo)" color #6c0) + item (label "서울 (Seoul)"))) diff --git a/test/examples/charts_editorial_stacked_areas.clp b/test/examples/charts_editorial_stacked_areas.clp index 2866c9254..7fd0434d7 100644 --- a/test/examples/charts_editorial_stacked_areas.clp +++ b/test/examples/charts_editorial_stacked_areas.clp @@ -1,67 +1,57 @@ -(width 1600px) -(height 800px) -(dpi 240) - -;;(set color-palette zhang) - -(limit-x (0 100)) -(limit-y (0 90)) - -(axes - position (bottom left) - label-placement-y (linear-interval 10 10 80) - border-style-left none - label-offset-left 0 - label-attach-left left - label-color-left #666) - -(grid - tick-placement-x (none) - tick-placement-y (linear-interval 10 10 80) - color (rgba 0 0 0 .1)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (7 13 17 27 38 39 52 59 48 60 65) - color 5 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (4 12 15 22 35 38 47 47 42 53 60) - color 4 - stroke-width .6pt - stroke-color (rgba 0 0 0 .4)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (3 10 10 18 32 34 42 40 36 46 54) - color 3 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (2 6 6 8 18 20 30 30 30 36 35) - color 2 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(areas - data-x (5 10 20 30 40 50 60 70 80 90 100) - data-y (1 2 4 7 13 15 20 16 18 23 18) - color 1 - stroke-width .6pt - stroke-color (rgba 0 0 0 .5)) - -(legend - position (top right) - margin 0 - padding 0 - item-flow on - item (label "Series A" color 1) - item (label "Series B" color 2) - item (label "Series C" color 3) - item (label "Series D" color 4) - item (label "Series E" color 5)) +(layer/resize 1600px 800px) +(layer/set-dpi 240) + +(tools/plotgen + limit-x (0 100) + limit-y (0 90) + axes ( + position (bottom left) + label-placement-y (linear-interval 10 10 80) + border-style-left none + label-offset-left 0 + label-attach-left left + label-color-left #666) + grid ( + tick-placement-x (none) + tick-placement-y (linear-interval 10 10 80) + color (rgba 0 0 0 0.1)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (7 13 17 27 38 39 52 59 48 60 65) + color 5 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (4 12 15 22 35 38 47 47 42 53 60) + color 4 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.4)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (3 10 10 18 32 34 42 40 36 46 54) + color 3 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (2 6 6 8 18 20 30 30 30 36 35) + color 2 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + areas ( + data-x (5 10 20 30 40 50 60 70 80 90 100) + data-y (1 2 4 7 13 15 20 16 18 23 18) + color 1 + stroke-width .6pt + stroke-color (rgba 0 0 0 0.5)) + legend ( + position (top right) + margin 0 + padding 0 + item-flow on + item (label "Series A" color 1) + item (label "Series B" color 2) + item (label "Series C" color 3) + item (label "Series D" color 4) + item (label "Series E" color 5))) diff --git a/test/examples/maps_gulf_of_mexico.clp b/test/examples/maps_gulf_of_mexico.clp index a646e677a..1e7ff7289 100644 --- a/test/examples/maps_gulf_of_mexico.clp +++ b/test/examples/maps_gulf_of_mexico.clp @@ -9,7 +9,7 @@ label-placement-y (linear 1) title-bottom "Longitude" title-left "Lattitude") - background fill + background (fill #eff7fe) grid ( tick-placement-x (linear 5) tick-placement-y (linear 5) diff --git a/test/examples/maps_submarine_cables.clp b/test/examples/maps_submarine_cables.clp deleted file mode 100644 index facc7778d..000000000 --- a/test/examples/maps_submarine_cables.clp +++ /dev/null @@ -1,31 +0,0 @@ -(width 2048px) -(height 1200px) -(dpi 220) - -(default limit-x (-180 180)) -(default limit-y (-80 100)) - -(draw/rectangle - fill #f9f9f9) - -(plot/grid - tick-placement-x (linear 10) - tick-placement-y (none) - color (rgba 0 0 0 .1) - stroke-style (dashed) - stroke-width .5pt) - -(plot/lines - data (geojson /home/paul/downloads/mapex/submarine_cables.geojson) - stroke-color #666 - stroke-width .5pt) - -(plot/polygons - data (geojson /home/paul/downloads/mapex/world.geojson) - fill #e8e8e8 - stroke-color #bbb - stroke-width .2pt) - -(figure/legend - item (label "Submarine cables")) - diff --git a/test/legend/legend_i18n.clp b/test/legend/legend_i18n.clp index 6146a12cb..88ca2e84c 100644 --- a/test/legend/legend_i18n.clp +++ b/test/legend/legend_i18n.clp @@ -1,16 +1,13 @@ -(dpi 400) -(width 2000px) -(height 2000px) - -(font-size 16pt) -;;(default text-script "Arabic") - -(legend - item (label "i北京市 (Beijing)" color #06c) - item (label "תל אביב (Tel Aviv)" color #c06) - item (label "القاهرة‎ (Cairo)" color #c06) - item (label "Москва" color #60c) - item (label "New York City 🌭 🗽 🇺🇸" color #60c) - item (label "東京都 (Tokyo)" color #6c0) - item (label "서울 (Seoul)")) +(layer/resize 2000px 2000px) +(layer/set-dpi 320) +(layer/set-font-size 14pt) +(tools/plotgen + legend ( + item (label "i北京市 (Beijing)" color #06c) + item (label "תל אביב (Tel Aviv)" color #c06) + item (label "القاهرة‎ (Cairo)" color #c06) + item (label "Москва" color #60c) + item (label "New York City 🌭 🗽 🇺🇸" color #60c) + item (label "東京都 (Tokyo)" color #6c0) + item (label "서울 (Seoul)"))) diff --git a/test/legend/legend_i18n.svg b/test/legend/legend_i18n.svg index ac67843c9..547278076 100644 --- a/test/legend/legend_i18n.svg +++ b/test/legend/legend_i18n.svg @@ -2,106 +2,106 @@ - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - - - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - + - + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/test/plot-points/markers_unicode.clp b/test/plot-points/markers_unicode.clp new file mode 100644 index 000000000..abe30b713 --- /dev/null +++ b/test/plot-points/markers_unicode.clp @@ -0,0 +1,16 @@ +(layer/resize 2048px 1024px) +(layer/set-dpi 240) + +(tools/plotgen + limit-y (-4 5) + limit-x (0 1000) + points ( + data-x (100 200 300 400 500 600 700 800 900) + data-y (-1.2 -1.8 -1.3 -1.6 -1.5 -1.3 -1.8 -1.9 -2.0) + shape (pentagon) + size 8pt) + points ( + data-x (100 200 300 400 500 600 700 800 900) + data-y (1.2 1.8 1.3 0.6 1.5 1.3 1.8 1.7 1.9) + shape (square-bullet) + size 8pt)) diff --git a/test/plot-points/markers_unicode.svg b/test/plot-points/markers_unicode.svg new file mode 100644 index 000000000..bb8e0f332 --- /dev/null +++ b/test/plot-points/markers_unicode.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/plot-points/markers_unicode_customfont.clp b/test/plot-points/markers_unicode_customfont.clp new file mode 100644 index 000000000..9c4fe3d56 --- /dev/null +++ b/test/plot-points/markers_unicode_customfont.clp @@ -0,0 +1,17 @@ +(layer/resize 2048px 1024px) +(layer/set-dpi 240) +(layer/set-font "Latin Modern Roman") + +(tools/plotgen + limit-y (-4 5) + limit-x (0 1000) + points ( + data-x (100 200 300 400 500 600 700 800 900) + data-y (-1.2 -1.8 -1.3 -1.6 -1.5 -1.3 -1.8 -1.9 -2.0) + shape (pentagon) + size 8pt) + points ( + data-x (100 200 300 400 500 600 700 800 900) + data-y (1.2 1.8 1.3 0.6 1.5 1.3 1.8 1.7 1.9) + shape (square-bullet) + size 8pt)) diff --git a/test/plot-points/markers_unicode_customfont.svg b/test/plot-points/markers_unicode_customfont.svg new file mode 100644 index 000000000..bb8e0f332 --- /dev/null +++ b/test/plot-points/markers_unicode_customfont.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file