Conversation
| return function(el) { | ||
| return function() { | ||
| return echarts.init(el, theme); | ||
| return echarts.init(el,theme); |
| brush = set "brush" <<< buildObj | ||
|
|
||
| brushType ∷ ∀ i. DSL TP.BrushToolboxI → DSL (brushType ∷ I|i) | ||
| brushType a = set "type" $ buildArr a |
There was a problem hiding this comment.
Shouldn't "type" be "brushType"? and same beloved for some other cases
There was a problem hiding this comment.
That's by design, too much type fields in js. But they all are different: e.g. type for brush, type for series, type for events etc. So, in built options this is just "type": ["blahblah"] but that blahblah may be used only in brush context.
| callback(e)(); | ||
| }); | ||
| var modifiedE = eName === "brush" ? addAll(this.getOption(), e) : e; | ||
| callback(modifiedE)(); |
There was a problem hiding this comment.
I'm fine with this, but as addAll is still mutating event, it can be written like this:
if (eName === "brush") {
addAll(this.getOption(), e);
}
callback(e)();| if (keysArr.indexOf(key) == -1) { | ||
| value = rawAction[key]; | ||
| } else { | ||
| value = maybe(undefined)(function(x) {return x;})(rawAction[key]); |
There was a problem hiding this comment.
We can pass fromMaybe instead of maybe (based on it's usage).
rawAction is normal js object right? so why do we need maybe for rawAction[key]? Also maybe is used only here not in upper branch, why?
There was a problem hiding this comment.
rawAction is purescript object :) I'll switch to fromMaybe
There was a problem hiding this comment.
Ah so maybeKeys is from type to array of such keys which contain js values wrapped in maybe? in various EChartsEvents I couldn't see any Maybe field
There was a problem hiding this comment.
like dataIndex is just Int so, where the Maybe comes from
| @@ -1,11 +1,123 @@ | |||
| function addData(area, axis, setKey) { | |||
There was a problem hiding this comment.
I do not understand what's going on in this functions, so cant really review it
There was a problem hiding this comment.
An event raised during selection of some area of chart. This event has area fields. These funcs adds params extracted from chart option to the event.
| import Math (cos, sin, (%)) | ||
|
|
||
| import Utils as U | ||
| import Unsafe.Coerce (unsafeCoerce) |
@safareli Good to go? |
|
|
||
| foreign import dispatchAction_ | ||
| ∷ ∀ e action | ||
| . action |
There was a problem hiding this comment.
can we change action to be { type ∷ String | r }?
| "unfocusnodeadjacency" → "unfocusNodeAdjacency" | ||
| s → s | ||
|
|
||
| action ∷ ∀ ω. { "type" ∷ String | ω } |
There was a problem hiding this comment.
Yep. At least w/o it my editor is going crazy
This adds some types to events, modifies
brushevent on during catching (this is needed to reconstruct data in SD) and adds some commands for brush.@safareli Please review