From e434ac9a1f97ce97f9e45ef77531f9939669ce84 Mon Sep 17 00:00:00 2001 From: Tyler Long Date: Tue, 6 Mar 2018 19:11:55 +0800 Subject: [PATCH] Improve gantt diagram code --- src/diagrams/gantt/ganttRenderer.js | 10 ++++------ todo.md | 18 ++++-------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/diagrams/gantt/ganttRenderer.js b/src/diagrams/gantt/ganttRenderer.js index e3072c096..c66a669b2 100644 --- a/src/diagrams/gantt/ganttRenderer.js +++ b/src/diagrams/gantt/ganttRenderer.js @@ -300,11 +300,9 @@ export const draw = function (text, id) { } formatter = pre.concat(mid).concat(post) - // let xAxis = d3.svg.axis() - // .scale(timeScale) - // .orient('bottom') - // .tickSize(-h + theTopPad + conf.gridLineStartPadding, 0, 0) - // .tickFormat(d3.time.format.multi(formatter)) + let xAxis = d3.axisBottom(timeScale) + .tickSize(-h + theTopPad + conf.gridLineStartPadding, 0, 0) + // .tickFormat(d3.time.format.multi(formatter)) // if (daysInChart > 7 && daysInChart < 230) { // xAxis = xAxis.ticks(d3.timeMonday.range) @@ -313,7 +311,7 @@ export const draw = function (text, id) { svg.append('g') .attr('class', 'grid') .attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')') - // .call(xAxis) // todo: fix this instead of commentting out + .call(xAxis) .selectAll('text') .style('text-anchor', 'middle') .attr('fill', '#000') diff --git a/todo.md b/todo.md index 380a96ceb..505a80853 100644 --- a/todo.md +++ b/todo.md @@ -1,22 +1,12 @@ -- Upgrade d3 to version 4 -- Use external d3-textwrap library - - rewrite src/d3.js - - Problem is it's for d3 v4 only -- Make node console output colors like Chrome console -- What's the correct way to change logLevel as an end user? - - mermaid.initialize({ logLevel: 1 }) +- Fix d3-textwrap code - Replace CodeClimate with coveralls ? - Get familar with jison - git graph requires a blank line at the end. why? -- Remove 'lodash' as dependency - - https://github.com/lodash/babel-plugin-lodash - - https://www.npmjs.com/package/lodash-webpack-plugin - global.mermaid_config - rewrite logger - rewrite less code -- d3 is possible to work with jsdom only. - - need to mock window size - - so mermaid could work without a browser at all - - But how to mesure font size? it's a problem. - Setup code coverage - Create a desktop client +- fix gantt diagram xAxis issue +- Fix sequence diagram node label position issue +- Fix flowchart interpolate/curve issue