slamdata / purescript-echarts

Purescript bindings for Baidu's Echarts library
36 stars 16 forks source link

Add support for `showTitle` in the toolbox #42

Closed thomashoneyman closed 7 years ago

thomashoneyman commented 7 years ago

Hi folks,

When hovering over an item in the “toolbox”, Chinese text displays beneath the icon. I’d like to hide this text.

In regular ECharts, you can do this with the showTitle field, as shown below. Applying this to the toolbox still allows use of a given feature, and on hover the icon still turns blue, but there is no text displayed below it. This is the behavior I'm looking for.

   toolbox: {
      show: true,
      feature: {
         saveAsImage: { show: true }
      },
      showTitle: false

You can also see it in the documentation here: https://ecomfe.github.io/echarts/doc/doc-en.html#Toolbox

I spent a while searching through the docs and source code for the bindings here and could not find the equivalent function.

Have I missed anything? Is there a way to replicate this behavior using these bindings? I’m willing to help, if I can, though I am still very new to PureScript.

cryogenian commented 7 years ago

Oh! Sorry for delay showTitle isn't implemented. It should be something

-- in phantom types module 
type ToolboxI =
  PositionMixin
  (ZMixin
   (SizeMixin
    ( feature ∷ I
    , show ∷ I
    , orient ∷ I
    , itemSize ∷ I
    , itemGap ∷ I
    , showTitle :: I
    , iconStyle ∷ I)))

-- in commands module 
showTitle ∷ ∀ i. Boolean → DSL (showTitle ∷ I|i)
showTitle a = set "showTitle" $ toForeign a