@daoyi/nmtl-ui 2.0.1-beta.116 → 2.0.1-beta.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -672,7 +672,8 @@ var BarChart = function BarChart(_ref) {
672
672
  var x = band().range([0, width]).domain(data.map(function (d) {
673
673
  return d.year;
674
674
  })).padding(0.2);
675
- svg.append('g').attr('id', 'xaxis').attr('transform', "translate(0,".concat(height, ")")).call(axisBottom(x)).style('color', fontColor).selectAll('text').attr('transform', 'translate(-10,0)rotate(-45)').style('text-anchor', 'end').style('color', fontColor).style('font-size', 16).style('cursor', 'pointer').on('click', function (d) {
675
+ svg.append('g').attr('id', 'xaxis').attr('transform', "translate(0,".concat(height, ")")).call(axisBottom(x)).style('color', fontColor).selectAll('text').attr('transform', 'translate(-10,0)rotate(-45)').style('text-anchor', 'end').style('color', fontColor)
676
+ /* WCAG 1.4.4 / Freego CS2140401C:D3 inline font-size 改相對單位(16→1rem) */.style('font-size', '1rem').style('cursor', 'pointer').on('click', function (d) {
676
677
  setSelectedYear(d);
677
678
  });
678
679
 
@@ -707,7 +708,8 @@ var BarChart = function BarChart(_ref) {
707
708
  });
708
709
  svg.append('g').call(axisLeft(y).tickValues(sequence(y.domain()[0], y.domain()[1] + 1, scaleTicks)).tickFormat(function (d) {
709
710
  return Math.round(d);
710
- })).attr('id', 'yaxis').style('color', fontColor).style('font-size', 15);
711
+ })).attr('id', 'yaxis').style('color', fontColor)
712
+ /* WCAG 1.4.4 / Freego CS2140401C:D3 inline font-size 改相對單位(15→0.9375rem) */.style('font-size', '0.9375rem');
711
713
  };
712
714
  function shiftYaxis() {
713
715
  var element = document.getElementById('barChart__block');
@@ -1505,7 +1505,8 @@ var SNA = function SNA(props) {
1505
1505
  return "M".concat(source.x, ", ").concat(source.y, " Q").concat(qx, " ").concat(qy, " ").concat(target.x, " ").concat(target.y);
1506
1506
  };
1507
1507
  var init = function init(networkData) {
1508
- var edgeLabelSize = '10px';
1508
+ /* WCAG 1.4.4 / Freego CS2140401C:SVG 文字字型尺寸改相對單位(10px→0.625rem) */
1509
+ var edgeLabelSize = '0.625rem';
1509
1510
  var lineRaduis = 30;
1510
1511
  var nodeStroke = 1.5;
1511
1512
  var nodeRadius = 10 - nodeStroke;
@@ -1577,13 +1578,15 @@ var SNA = function SNA(props) {
1577
1578
  });
1578
1579
  var nodeLabel = g.append('g').selectAll('text').data(nodes).join('text').attr('fill', fontColor).attr('text-anchor', 'middle').attr('key', function (d) {
1579
1580
  return d.type;
1580
- }).style('color', '#fff').style('font-size', '14px').text(function (d) {
1581
+ }).style('color', '#fff')
1582
+ /* WCAG 1.4.4 / Freego CS2140401C:SVG 文字字型尺寸改相對單位(14px→0.875rem) */.style('font-size', '0.875rem').text(function (d) {
1581
1583
  return d.name;
1582
1584
  });
1583
1585
  var edgepaths = g.selectAll('.edgepath').data(links).enter().append('path').attr('class', 'edgepath').attr('fill-opacity', 0).attr('stroke-opacity', 0).attr('id', function (d, i) {
1584
1586
  return "edgepath".concat(i);
1585
1587
  }).style('pointer-events', 'none');
1586
- var edgelabels = g.selectAll('.edgelabel').data(links).enter().append('text').style('pointer-events', 'none').attr('class', 'edgelabel').attr('font-size', edgeLabelSize).attr('fill', '#aaa').attr('visibility', 'visible').attr('key', function (d) {
1588
+ var edgelabels = g.selectAll('.edgelabel').data(links).enter().append('text').style('pointer-events', 'none').attr('class', 'edgelabel')
1589
+ /* rem 需以 style 設定(SVG presentation attribute 對 rem 支援不一致) */.style('font-size', edgeLabelSize).attr('fill', '#aaa').attr('visibility', 'visible').attr('key', function (d) {
1587
1590
  return d.type;
1588
1591
  }).attr('id', function (d, i) {
1589
1592
  return "edgelabel".concat(i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daoyi/nmtl-ui",
3
- "version": "2.0.1-beta.116",
3
+ "version": "2.0.1-beta.117",
4
4
  "description": "This project is to be used as a starter kit for building React component using Storybook and Rollup",
5
5
  "author": "daoyi",
6
6
  "main": "lib/index.js",