Created
February 24, 2019 18:51
-
-
Save uditalias/b7c05317c16f72e72ce7c335cb111ad1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private hydrateRendererLanguages(): Array<IRendererLanguage & { rotation: number; translateX: number; translateY: number; }> { | |
const results = []; | |
const languagesRows = _.chunk(this.languages, this.options.columns); | |
let currentLanguage: IRendererLanguage; | |
for (let i = 0, rows = languagesRows.length; i < rows; i++) { | |
for (let j = 0, columns = languagesRows[i].length; j < columns; j++) { | |
currentLanguage = languagesRows[i][j]; | |
results.push({ | |
...currentLanguage, | |
rotation: currentLanguage.percent / 100 * (ROTATION_EDGE_DEGREE * 2) - ROTATION_EDGE_DEGREE, | |
translateX: j * GAUGE_WIDTH, | |
translateY: i * GAUGE_HEIGHT | |
}); | |
} | |
} | |
return results; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment