-
Notifications
You must be signed in to change notification settings - Fork 32
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
Gobierto Visualizations / Translate categories #3745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't we using Rails I18n files here? You are re-inventing the wheel
@@ -0,0 +1,74 @@ | |||
export const categoryTitleEng = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are not exactly the titles in English, these are the translation keys. I'm saying it because maybe in the future there are real English translations and they object should have this name (just like categoryTitlesCat
and categoryTitlesEsp
).
contractsDataMap.map(d => { | ||
const { category_title } = d | ||
/*If the contract isn't categorized, we include it in other*/ | ||
if (!category_title) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this in the end, since they will never come as null (and if they do, we should know to fix it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Done!
Ouch. Fixed. |
@@ -309,7 +309,7 @@ export default { | |||
} else if (deepLevel === 3 && scaleColor && depth === 2) { | |||
return this.colors(contracts[this.firstDepthForTreeMap]) | |||
} else { | |||
return '#12365b' | |||
return '#118e9c' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be dynamic to avoid what just happened?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -1,7 +1,7 @@ | |||
import { scaleOrdinal } from 'd3-scale'; | |||
|
|||
export function createScaleColors(values, arrayDomain) { | |||
let colorsGobiertoExtend = ["#12365b", "#118e9c", "#ff766c", "#f7b200", "#158a2c", "#94d2cf", "#3a78c3", "#15dec5", "#6a7f2f", "#55f17b"] | |||
let colorsGobiertoExtend = ["#118e9c", "#12365b", "#ff766c", "#f7b200", "#158a2c", "#94d2cf", "#3a78c3", "#15dec5", "#6a7f2f", "#55f17b"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we be using here CSS variables of the brand colors? I guess this are already defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I've added the Gobierto colors to the css-confs
as CSS vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better!
Closes #N
✌️ What does this PR do?
🔍 How should this be manually tested?
Staging
👀 Screenshots
After this PR