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

Data Type Icons #43

Merged
merged 14 commits into from Jan 25, 2015
Merged

Data Type Icons #43

merged 14 commits into from Jan 25, 2015

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Jan 18, 2015

Add data type icons

Please merge #43 first!

localhost_9000

@domoritz
Copy link
Member

Can you change the type to the primitive type in the schmea? The data type is only defined once a field is dropped. We're mixing different concepts here.

@kanitw
Copy link
Member Author

kanitw commented Jan 18, 2015

We really should have a proper conversation about data type.

I don’t think we need to expose primitive data types (int, long, string) in the interface at all.

It makes sense to expose “number”, “text”, “location”, “time”.

However, the way we (and Tableau) treat ordinal, quantitative right now makes
ordinal = text
quantitative = number
geo = location
time = time

In reality, some text are ordinal, some are categorical, blah blah but if we want to distinguish text and ordinal then we should distinguish between ordinal / categorical? Otherwise, I can’t think of any benefits from doing this yet.

@domoritz
Copy link
Member

Yes, right now we have the direct correspondence but in the code we should make the difference clear. For example, for the study, I'd say we should make numbers with a small cardinality (cylinders for example in the car dataset) ordinal.

@kanitw
Copy link
Member Author

kanitw commented Jan 18, 2015

Okay. WIll ping you once I update vg.data.getStats() and setSchemaAndStats()

@kanitw kanitw mentioned this pull request Jan 20, 2015
(1) we're already using autoprefixer so there is no point to use both compass mix-ins and auto-prefixer
(2) turn out that it takes too much time to setup compass in facetedviz so I think this is a corner that we can cut
Conflicts:
	app/scripts/services/dataset.js
	app/styles/vlui-common.scss
Conflicts:
	app/scripts/vendor/vegalite.js
Conflicts:
	app/scripts/services/dataset.js
@kanitw
Copy link
Member Author

kanitw commented Jan 23, 2015

@domoritz Now I remember what I wanted to ask you — it’s about this topic.

We talked about two types of data types: primitive types and semantic types (I’ll call it role here)

Originally you say we need to know primitive type in the system because the icon shows primitive types.
In fact, I don’t think it is the case. geo data’s primitive type is still text.

But we should either have a custom schema file for each datasets we gonna use in the study
(to say that this field has geo-state role by default.) or let user change the default role.

For changing “default" role, I really think that we should have it on the left side.
(You probably don’t want to cast the state field to have “state" role/type everytime.)

But allow casting on the right side.

Now I summarize relationship between default role and supported casting

role: roles that we can cast to

ordinal/text: ordinal
number/quantitative: quantitative / ordinal
geo-* (e.g., geo-state): geo / ordinal
time: time

I put "ordinal/text, number/quantitative” above because I’m not sure how should we name things up there because it’s mixing between different ways of calling data types.

In any case, selected role would affect supported function / scale type

  • ordinal would simply use scale.type = ordinal
  • quantitative would offer variants of scale.type (linear, log, …)
  • geo would offer lat/long functions with projection type (e.g., mercator) — we should add geo encoding as a special case for user?
  • time would offer time binning functions (year, month, day, …)

What do you think?

@kanitw
Copy link
Member Author

kanitw commented Jan 23, 2015

Okay, now I modify the code and it should work

Note that I use vegalite’s type as the type value that we pass around the system but display human friendly text (vlui type) in the UI.

@domoritz
Copy link
Member

A lot of commits for a few changes but whateva.

domoritz added a commit that referenced this pull request Jan 25, 2015
@domoritz domoritz merged commit e72db4d into master Jan 25, 2015
@domoritz
Copy link
Member

Please merge #43 first!

I had a stack overflow. Please don't add recursion to pr in the future.

@domoritz domoritz deleted the kw/icons branch January 25, 2015 01:35
@kanitw
Copy link
Member Author

kanitw commented Jan 25, 2015

lol that's a typo.

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

Successfully merging this pull request may close these issues.

None yet

2 participants