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

Implement per-column table styling #1302

Merged
merged 15 commits into from
Feb 22, 2016
Merged

Implement per-column table styling #1302

merged 15 commits into from
Feb 22, 2016

Conversation

RacingTadpole
Copy link
Contributor

Fixes #1097.

Columns can be specified by either their name in the csv file, or their position (0 for the first column, etc). I've added name and type to the list of tableStyle parameters that apply in tableStyle.columns.

An example is the final catalog item at http://localhost:3001/#build/terriajs/test/init/test-tablestyle.json .

One implementation decision I've made, which we can discuss, is: if you supply a new name for a column, but not a type, its type is guessed based on the new name, not its old name.

Unsupported in this PR:

  • Setting columns.x.type to region
  • columns.x.regionType
  • Columns cannot be specified by regex.

* @alias TableColumnStyle
* @constructor
*
* @param {Object} [options] The values of the properties of the new instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have the values of the potential options like in other constructors that take options hashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very true. I just copied it over from TableStyle, which didn't have it either. But I'll add it.

@AlexGilleran
Copy link
Contributor

So cool 🌈 .

As discussed on slack though:

 "columns": {
               "Value": {
                 "name": "Postal code"
               },
}

results in:

image

Probably should say "Postal code" not "Value" :).

@RacingTadpole
Copy link
Contributor Author

@AlexGilleran: I've added your suggestions now. I've also built on this quite a bit in #1307, and I might have cleaned up some things there that really should be here... sorry...

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.

2 participants