Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use log scale with bar? #1368

Closed
domoritz opened this issue May 18, 2016 · 17 comments
Closed

Can't use log scale with bar? #1368

domoritz opened this issue May 18, 2016 · 17 comments
Assignees
Milestone

Comments

@domoritz
Copy link
Member

domoritz commented May 18, 2016

For example, we can't add scale: {type: "log"} to the histogram example.

{
  "data": {"url": "data/movies.json"},
  "mark": "bar",
  "encoding": {
    "x": {
      "bin": {"maxbins": 10},
      "field": "IMDB_Rating",
      "type": "quantitative"
    },
    "y": {
      "aggregate": "count",
      "field": "*",
      "type": "quantitative",
      "scale": {"type": "log"}
    }
  }
}
@kanitw kanitw added this to the 1.0.x Important Patches milestone May 18, 2016
@kanitw
Copy link
Member

kanitw commented May 18, 2016

The culprit is that we for bar, we output

"y2": {"scale": "y","value": 0}

So we should avoid passing 0 through log scale) by default for bar / area.
The solution is probably don't include scale if the scale type is log by default.

@ayush29feb since you have to modify mark.properties, could you take care of this too? This should not take too much time to fix.

@kanitw kanitw changed the title Can't use log scale with count? Can't use log scale with bar? May 18, 2016
@jheer
Copy link
Member

jheer commented May 18, 2016

This is worth fixing. But for the examples, I recommend not using bar
charts over a log-scaled domain. A dot plot would be a better example of
what to do!

On Wed, May 18, 2016 at 2:49 PM, Kanit Wongsuphasawat <
notifications@github.com> wrote:

The culprit is that we for bar, we output

"y2": {"scale": "y","value": 0}

So we should avoid passing 0 through log scale) by default for bar / area.
The solution is probably don't include scale if the scale type is log by
default.

@ayush29feb https://github.com/ayush29feb since you have to modify
mark.properties, could you take care of this too? This should not take
too much time to fix.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1368 (comment)

@kanitw
Copy link
Member

kanitw commented May 18, 2016

But for the examples, I recommend not using bar charts over a log-scaled domain. A dot plot would be a better example of what to do!

Yep. We definitely wouldn't include this in the example gallery.

More note for @ayush29feb, if we don't pass this through the scale, the correct value might not always be 0. For example, y-axis's value should be the height.

@domoritz
Copy link
Member Author

@kanitw makes sense. Points work.

screen shot 2016-05-18 at 15 33 20

@ayush29feb
Copy link

Yeah I can take care of it while working on #1284 over the weekend

@domoritz
Copy link
Member Author

Thanks

On Wed, May 18, 2016, 19:50 Ayush Saraf notifications@github.com wrote:

Yeah I can take care of it while working on #1284
#1284 over the weekend


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1368 (comment)

@domoritz
Copy link
Member Author

@kanitw How should @ayush29feb get the height of the visualization/ cell? He needs to get it from the layout because the cellHeight may not be the actual height for instance with layering.

@kanitw
Copy link
Member

kanitw commented May 21, 2016

If you have layering that two layers do not have the same cellHeight, both layer should have their own cellHeight (with the correct prefix) so I don't see why that is an issue.

@domoritz
Copy link
Member Author

The cell height will only be available from the layout data source, though.

@kanitw
Copy link
Member

kanitw commented May 21, 2016

The cell height will only be available from the layout data source, though.

If you have two layers that do not have the same layout, there should be more than one layout data sources.

@domoritz
Copy link
Member Author

My question is how we access the layout from the mark properties?

@kanitw
Copy link
Member

kanitw commented May 21, 2016

My question is how we access the layout from the mark properties?

Good question. I was wrong about this sentence. (My memory starts coming back.)

If you have two layers that do not have the same layout, there should be more than one layout data sources.

The correct one is "there should be more than one *-cellHeight fields in the layout data source.

@domoritz
Copy link
Member Author

The correct one is "there should be more than one *-cellHeight fields in the layout data source.

This is not the issue. The issue is only how to access the layout data source.

@kanitw
Copy link
Member

kanitw commented May 22, 2016

Actually, just like rule, you can use {group: 'width'} (or height)?

@ayush29feb
Copy link

Yeah @domoritz, I think you actually can do that.

@domoritz
Copy link
Member Author

I see. So we don't need access to the layout data source. Perfect.

@kanitw kanitw assigned ayush29feb and unassigned ayush29feb May 23, 2016
@kanitw
Copy link
Member

kanitw commented Jun 10, 2016

Another case -- I think we have the same problem if scale.zero = false :)

@kanitw kanitw closed this as completed in c0c986a Jul 9, 2016
@kanitw kanitw removed the #-to assign label Jul 9, 2016
@kanitw kanitw modified the milestones: 2.0.0-pre Important Feature & Patches, 1.x.x Patches Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants