Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Uncaught TypeError: v is not a function on bar hover without any tooltip config #40

Closed
swapsCAPS opened this issue Oct 17, 2018 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@swapsCAPS
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Console.errors with Uncaught TypeError: v is not a function when you hover over a bar in a bar chart without any tooltip config.

What is the expected behavior?
No errors

Which versions of MuzeJS, and which browser/OS are affected by this issue? Did this work in previous versions of MuzeJS?
1.0.3 Chrome

@ranajitbanerjee
Copy link
Member

@swapsCAPS Cannot replicate the issue. Can you please share the data and the code sample?

@swapsCAPS
Copy link
Author

Sure here you go : )

import _    from "underscore"
import m    from "moment"
import muze from "muze"

{ DataModel }     = muze
{ groupBy, sort } = DataModel.Operators

schema = [
	{
		name:     "total"
		type:     "measure"
		defAggFn: "avg"
	}
	{
		name:    "start"
		type:    "dimension"
		subtype: "temporal"
	}
	{
		name:    "day"
		type:    "dimension"
		subtype: "datetime"
		format:  "%d"
	}
]

data = [
	{ total: 5, start: m().subtract(1, "days") }
	{ total: 4, start: m().subtract(4, "days") }
	{ total: 9, start: m().subtract(1, "days") }
	{ total: 1, start: m().subtract(4, "days") }
	{ total: 8, start: m().subtract(3, "days") }
	{ total: 6, start: m().subtract(2, "days") }
	{ total: 2, start: m().subtract(3, "days") }
	{ total: 3, start: m().subtract(2, "days") }
]

data = _.map data, (d) ->
	_.extend {}, d,
		start: +d.start
		day:   m(d.start).format "DD"

groupFn = groupBy ["day"], total: "avg"
sortFn  = sort    [ "day", "ASC" ]

dm = new DataModel data, schema

dm = groupFn sortFn dm

canvas
	.data    dm
	.width   600
	.height  450
	.rows    [ "total" ]
	.columns [ "day" ]
	.mount   "#chart-container"

@adotg
Copy link
Contributor

adotg commented Oct 18, 2018

@adotg adotg added the bug Something isn't working label Oct 18, 2018
@ranajitbanerjee
Copy link
Member

@swapsCAPS Working version https://jsfiddle.net/a72zypv1/8/. the variable day is just a categorical variable, not a temporal variable in this context. And there is no subtype called 'datetime'. Did you see anywhere in docs that the subtype of a variable is written as 'datetime' ?

However, the expected behaviour is to ignore this datetime subtype and treat it as categorical. Which i am gonna fix.

@swapsCAPS
Copy link
Author

No did not see it in the docs. In the source I think, yesterday at the end of the day when I was fiddling around trying to fix it.

@adotg adotg added this to To do in Muze & Datamodel via automation Oct 18, 2018
@adotg
Copy link
Contributor

adotg commented Oct 18, 2018

Reopening this as

ignore datetime subtype and treat it as categorical

needs to be fixed.

@adotg adotg reopened this Oct 18, 2018
@mridulmeh mridulmeh added this to the Initiation Sprint milestone Jan 10, 2019
@adotg adotg closed this as completed Feb 1, 2019
Muze & Datamodel automation moved this from To do to Done Feb 1, 2019
adarshlilha pushed a commit that referenced this issue Dec 2, 2019
feature/MZ-25: Fix gradient legend interaction
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

4 participants