packages feed

hvega 0.7.0.0 → 0.7.0.1

raw patch · 9 files changed

+219/−17 lines, 9 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,6 +1,10 @@ For the latest version of this document, please see [https://github.com/DougBurke/hvega/blob/master/hvega/CHANGELOG.md](https://github.com/DougBurke/hvega/blob/master/hvega/CHANGELOG.md). +## 0.7.0.1++Minor documentation fixes (typos and fixing links).+ ## 0.7.0.0  The Vega-Lite tests are now validated against version 4.7 of the
hvega.cabal view
@@ -1,5 +1,5 @@ name:                hvega-version:             0.7.0.0+version:             0.7.0.1 synopsis:            Create Vega-Lite visualizations (version 4) in Haskell. description:         This is based on the elm-vegalite package                      (<http://package.elm-lang.org/packages/gicentre/elm-vegalite/latest>)
src/Graphics/Vega/VegaLite.hs view
@@ -1201,7 +1201,8 @@  -- $update0700 -- The @0.7.0.0@ release updates @hvega@ to support version 4.7 of--- the Vega-Lite schema.+-- the Vega-Lite schema. The @0.7.0.1@ update fixes several minor+-- documentation issues. -- -- __New functionality__ --
src/Graphics/Vega/VegaLite/Configuration.hs view
@@ -168,7 +168,7 @@  - the @RemoveInvalid@ constructor was removed, as the new 'Graphics.Vega.VegaLite.MRemoveInvalid' constructor for the-'Graphics.Vega.VegaLite.MarkProperty' type should be used instead+'MarkProperty' type should be used instead (so @'configuration' (RemoveInvalid b)@ changes to @'configuration' ('Graphics.Vega.VegaLite.MarkStyle' ['Graphics.Vega.VegaLite.MRemoveInvalid' b])@. @@ -811,9 +811,11 @@       --   chosen overlap strategy).       --       --   @since 0.4.0.0-    | LeLayout [LegendLayout]+    | LeLayout [LegendLayout]  -- TODO: schema for this is odd; check it is meaningful       -- ^ Layout parameters for the legend orient group.       --+      --   It is not clear if this is used in Vega Lite 4.2 or later.+      --       --   @since 0.4.0.0      | LeLeX Double       -- ^ Custom x position for a legend with orientation 'Graphics.Vega.VegaLite.LONone'.@@ -1023,6 +1025,9 @@ Properties for customising the colors of a range. The parameter should be a named color scheme such as @\"accent\"@ or @\"purpleorange-11\"@. For details see the <https://vega.github.io/vega/docs/schemes/#scheme-properties Vega-Lite documentation>.++Used by 'RangeStyle'.+ -} data RangeConfig     = RCategory T.Text
src/Graphics/Vega/VegaLite/Mark.hs view
@@ -212,12 +212,14 @@ @\"No\"@ variant of the constructor is used (e.g. 'MNoBox').  In @version 0.5.0.0@ the 'MRemoveInvalid' constructor was added, which-replaces the @RemoveInvalid@ constructor of-'Graphics.Vega.VegaLite.ConfigurationProperty', and the+replaces the @RemoveInvalid@ constructor of @ConfigurationProperty@, and the @MShortTimeLabels@ constuctor was removed.  -} +-- DOC NOTE: using 'Graphics.Vega.VegaLite.ConfigurationProperty' doesn't create+-- the correct link, so changed to @ConfigurationProperty@.+ -- based on schema --     #/definitions/MarkConfig --     #/definitions/MarkDef@@ -1032,23 +1034,20 @@ textdirLabel RTL = "rtl"  --- | The blend mode for drawing an item on its background.+-- | The blend mode for drawing an item on its background. This is used with 'MBlend'. -- --   This is based on CSS <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode mix-blend-mode>---   and the default is 'BMNormal' (at least for SVG output).+--   and the default is 'BMNormal'. -- --   Added in Vega-Lite 4.6.0. -----   It is currently unclear how this works with canvas outputs---   (see Vega-Lite <https://github.com/vega/vega-lite/pull/6033 #6033>---   and <https://github.com/vega/vega-lite/issues/6100 #6100>---   for more information).--- --   @since 0.7.0.0  data BlendMode   = BMNormal-    -- ^ @normal@ mode (this maps to @null@ in Vega-Lite).+    -- ^ The default behavior for Vega-Lite, which is the @\"normal\"@ CSS mix-blend-mode+    --   for SVG output and @\"source-over\"@ for Canvas output (this constructor+    --   creates a @null@ value in the JON output).   | BMMultiply     -- ^ @multiply@ mode.   | BMScreen@@ -1056,7 +1055,7 @@   | BMOverlay     -- ^ @overlay@ mode.   | BMDarken-    -- ^ @daren@ mode.+    -- ^ @darken@ mode.   | BMLighten     -- ^ @lighten@ mode.   | BMColorDodge
stack.yaml view
@@ -5,4 +5,4 @@  extra-deps: [] -resolver: lts-15.0+resolver: lts-15.5
tests/Gallery/Bar.hs view
@@ -35,6 +35,8 @@             , ("signedpopulation", signedPopulation)             , ("labeloverlay", labelOverlay)             , ("wilkinsondotplot", wilkinsonDotPlot)+            , ("initialletter", initialLetter)+            , ("barnegative", barNegative)             ]  @@ -55,6 +57,10 @@            . configuration (ViewStyle [ ViewNoStroke ])  +seattleWeather :: Data+seattleWeather = dataFromUrl "https://vega.github.io/vega-lite/data/seattle-weather.csv" []++ -- bar1 in GalleryBar.elm bar1 :: VegaLite bar1 =@@ -190,7 +196,7 @@     in     toVegaLite         [ des-        , dataFromUrl "https://vega.github.io/vega-lite/data/seattle-weather.csv" []+        , seattleWeather         , mark Bar []         , enc []         ]@@ -716,3 +722,72 @@         , enc []         , mark Circle [ MOpacity 1 ]         ]+++-- From https://vega.github.io/vega-lite/examples/bar_month_temporal_initial.html+-- but teaked to add a few bar properties.+--+initialLetter :: VegaLite+initialLetter =+  let desc = "Using `labelExpr` to show only initial letters of month names."++  in toVegaLite [ description desc+                , width 400+                , height 300+                , seattleWeather+                , mark Bar [ MBlend BMDifference+                           , MColorGradient GrLinear+                             [ (0, "orange"), (1, "cyan") ]+                             []+                           , MCornerRadius 10+                           , MStroke "yellow"+                           , MStrokeWidth 4+                           , MTooltip TTData+                           ]+                , encoding+                  . position X [ PName "date"+                               , PmType Temporal+                               , PTimeUnit Month+                               , PAxis [ AxLabelAlign AlignLeft+                                       , AxLabelExpr "datum.label[0]"+                                       ]+                               ]+                  . position Y [ PName "precipitation"+                               , PmType Quantitative+                               , PAggregate Mean+                               ]+                  $ []+                ]+++-- From https://vega.github.io/vega-lite/examples/bar_negative.html+--+barNegative :: VegaLite+barNegative =+  let desc = "A bar chart with negative values. We can hide the axis domain line, and instead use a conditional grid color to draw a zero baseline."++      barData = dataFromColumns []+                . dataColumn "a" (Strings ["A", "B", "C", "D", "E", "F", "G", "H", "I"])+                . dataColumn "b" (Numbers [-28, 55, -33, 91, 81, 53, -19, 87, 52])+                $ []++  in toVegaLite [ description desc+                , barData+                , mark Bar []+                , encoding+                  . position X [ PName "a"+                               , PmType Ordinal+                               , PAxis [ AxDomain False+                                       , AxTicks False+                                       , AxLabelAngle 0+                                       , AxLabelPadding 4 ]+                               ]+                  . position Y [ PName "b"+                               , PmType Quantitative+                               , PAxis [ AxDataCondition+                                         (Expr "datum.value === 0")+                                         (CAxGridColor "black" "#ddd")+                                       ]+                               ]+                  $ []+                ]
+ tests/specs/gallery/bar/barnegative.vl view
@@ -0,0 +1,70 @@+{+    "mark": "bar",+    "data": {+        "values": [+            {+                "a": "A",+                "b": -28+            },+            {+                "a": "B",+                "b": 55+            },+            {+                "a": "C",+                "b": -33+            },+            {+                "a": "D",+                "b": 91+            },+            {+                "a": "E",+                "b": 81+            },+            {+                "a": "F",+                "b": 53+            },+            {+                "a": "G",+                "b": -19+            },+            {+                "a": "H",+                "b": 87+            },+            {+                "a": "I",+                "b": 52+            }+        ]+    },+    "$schema": "https://vega.github.io/schema/vega-lite/v4.json",+    "encoding": {+        "x": {+            "field": "a",+            "type": "ordinal",+            "axis": {+                "labelAngle": 0,+                "domain": false,+                "labelPadding": 4,+                "ticks": false+            }+        },+        "y": {+            "field": "b",+            "type": "quantitative",+            "axis": {+                "gridColor": {+                    "value": "#ddd",+                    "condition": {+                        "value": "black",+                        "test": "datum.value === 0"+                    }+                }+            }+        }+    },+    "description": "A bar chart with negative values. We can hide the axis domain line, and instead use a conditional grid color to draw a zero baseline."+}
+ tests/specs/gallery/bar/initialletter.vl view
@@ -0,0 +1,48 @@+{+    "height": 300,+    "mark": {+        "cornerRadius": 10,+        "strokeWidth": 4,+        "color": {+            "stops": [+                {+                    "color": "orange",+                    "offset": 0+                },+                {+                    "color": "cyan",+                    "offset": 1+                }+            ],+            "gradient": "linear"+        },+        "blend": "difference",+        "stroke": "yellow",+        "tooltip": {+            "content": "data"+        },+        "type": "bar"+    },+    "data": {+        "url": "https://vega.github.io/vega-lite/data/seattle-weather.csv"+    },+    "width": 400,+    "$schema": "https://vega.github.io/schema/vega-lite/v4.json",+    "encoding": {+        "x": {+            "field": "date",+            "timeUnit": "month",+            "type": "temporal",+            "axis": {+                "labelExpr": "datum.label[0]",+                "labelAlign": "left"+            }+        },+        "y": {+            "field": "precipitation",+            "aggregate": "mean",+            "type": "quantitative"+        }+    },+    "description": "Using `labelExpr` to show only initial letters of month names."+}