{"version":3,"sources":["jsdelivr-header.js","/npm/d3-svg-legend@2.25.6/src/legend.js","/npm/d3-svg-legend@2.25.6/src/color.js","/npm/d3-svg-legend@2.25.6/src/size.js","/npm/d3-svg-legend@2.25.6/src/symbol.js","/npm/d3-svg-legend@2.25.6/src/helpers.js","/npm/d3-svg-legend@2.25.6/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,6oBCHM,EAAc,SAAA,G,OAAK,C,EAEnB,EAAa,SAAA,G,QACX,EAAS,GACN,EAAI,EAAG,EAAI,EAAI,OAAQ,EAAI,EAAG,I,EAC9B,GAAK,EAAI,EAAI,EAAI,G,OAEnB,C,EAIH,EAAkB,SAAC,EAAM,G,EACxB,MAAK,W,QAMN,EALE,EAAO,SAAO,MAChB,EAAQ,EACL,OACA,MAAM,OACN,UAEH,EAAO,GAIP,GADI,EAAK,KAAK,KACT,WAAW,EAAK,KAAK,QAAU,GACpC,EAAQ,EACL,KAAK,MACL,OAAO,SACP,KAAK,IAAK,GACV,KAAK,KAAM,EAAK,MAEb,EAAO,EAAM,O,EACd,KAAK,G,EACJ,KAAK,EAAK,KAAK,MACjB,EAAM,OAAO,wBAA0B,GAAS,EAAK,OAAS,I,EAC3D,M,EACC,KAAK,EAAK,KAAK,M,EACd,CAAC,G,EACA,EACL,OAAO,SACP,KAAK,IAAK,GACV,KAAK,KAnBG,IAmBgB,EAAK,MAC7B,KAAK,G,KAgGhB,EAAe,C,cACE,SACb,EACA,EACA,EACA,EACA,EACA,GAEc,SAAV,E,EACK,KAAK,SAAU,GAAa,KAAK,QAAS,GAC9B,WAAV,E,EACF,KAAK,IAAK,GACE,SAAV,E,EAEN,KAAK,KAAM,GACX,KAAK,KAAM,GACX,KAAK,KAAM,GACX,KAAK,KAAM,GACK,SAAV,G,EACF,KAAK,IAAK,E,aAIT,SAAS,EAAK,EAAO,EAAQ,EAAa,G,EAC9C,OAAO,QAAQ,KAAK,QAAS,EAAc,S,IAC3C,EAAO,EACV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P,GAFuB,C,IAKzB,YAAc,SAAS,G,OACvB,UAAU,Q,EACD,EACP,GAFuB,C,IAKzB,MAAQ,SAAS,G,OACjB,UAAU,Q,EACP,EACD,GAFuB,C,IAKzB,WAAa,SAAS,G,OACtB,UAAU,Q,EACF,EACN,GAFuB,C,IAKzB,GAAK,W,IACJ,EAAQ,EAAiB,GAAG,MAAM,EAAkB,W,OACnD,IAAU,EAAmB,EAAS,C,EAGxC,C,CC7OF,IAgBP,EAAe,C,gBAhBgB,SAAA,G,IAC7B,EAIC,EAJD,EACA,EAGC,EAHD,UACA,EAEC,EAFD,gBACA,EACC,EADD,e,OAEU,IAAN,E,aACa,EAAgB,GAAG,MAAnB,IAA6B,EAA7B,KACY,GAClB,IAAM,EAAY,EACZ,EAAgB,GAAG,MAAnB,IAA6B,EAA7B,KACE,GAAjB,WAEK,EAAgB,E,GCNzB,EAAe,C","file":"/npm/d3-svg-legend@2.25.6/indexRollup.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/d3-svg-legend@2.25.6/indexRollup.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { select } from \"d3-selection\"\nimport { format, formatPrefix } from \"d3-format\"\n\nconst d3_identity = d => d\n\nconst d3_reverse = arr => {\n  const mirror = []\n  for (let i = 0, l = arr.length; i < l; i++) {\n    mirror[i] = arr[l - i - 1]\n  }\n  return mirror\n}\n\n//Text wrapping code adapted from Mike Bostock\nconst d3_textWrapping = (text, width) => {\n  text.each(function() {\n    var text = select(this),\n      words = text\n        .text()\n        .split(/\\s+/)\n        .reverse(),\n      word,\n      line = [],\n      lineNumber = 0,\n      lineHeight = 1.2, //ems\n      y = text.attr(\"y\"),\n      dy = parseFloat(text.attr(\"dy\")) || 0,\n      tspan = text\n        .text(null)\n        .append(\"tspan\")\n        .attr(\"x\", 0)\n        .attr(\"dy\", dy + \"em\")\n\n    while ((word = words.pop())) {\n      line.push(word)\n      tspan.text(line.join(\" \"))\n      if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n        line.pop()\n        tspan.text(line.join(\" \"))\n        line = [word]\n        tspan = text\n          .append(\"tspan\")\n          .attr(\"x\", 0)\n          .attr(\"dy\", lineHeight + dy + \"em\")\n          .text(word)\n      }\n    }\n  })\n}\n\nconst d3_mergeLabels = (gen = [], labels, domain, range, labelDelimiter) => {\n  if (typeof labels === \"object\") {\n    if (labels.length === 0) return gen\n\n    let i = labels.length\n    for (; i < gen.length; i++) {\n      labels.push(gen[i])\n    }\n    return labels\n  } else if (typeof labels === \"function\") {\n    const customLabels = []\n    const genLength = gen.length\n    for (let i = 0; i < genLength; i++) {\n      customLabels.push(\n        labels({\n          i,\n          genLength,\n          generatedLabels: gen,\n          domain,\n          range,\n          labelDelimiter\n        })\n      )\n    }\n    return customLabels\n  }\n\n  return gen\n}\n\nconst d3_linearLegend = (scale, cells, labelFormat) => {\n  let data = []\n\n  if (cells.length > 1) {\n    data = cells\n  } else {\n    const domain = scale.domain(),\n      increment = (domain[domain.length - 1] - domain[0]) / (cells - 1)\n    let i = 0\n\n    for (; i < cells; i++) {\n      data.push(domain[0] + i * increment)\n    }\n  }\n\n  const labels = data.map(labelFormat)\n  return {\n    data: data,\n    labels: labels,\n    feature: d => scale(d)\n  }\n}\n\nconst d3_quantLegend = (scale, labelFormat, labelDelimiter) => {\n  const labels = scale.range().map(d => {\n    const invert = scale.invertExtent(d)\n    return (\n      labelFormat(invert[0]) +\n      \" \" +\n      labelDelimiter +\n      \" \" +\n      labelFormat(invert[1])\n    )\n  })\n\n  return {\n    data: scale.range(),\n    labels: labels,\n    feature: d3_identity\n  }\n}\n\nconst d3_ordinalLegend = scale => ({\n  data: scale.domain(),\n  labels: scale.domain(),\n  feature: d => scale(d)\n})\n\nconst d3_cellOver = (cellDispatcher, d, obj) => {\n  cellDispatcher.call(\"cellover\", obj, d)\n}\n\nconst d3_cellOut = (cellDispatcher, d, obj) => {\n  cellDispatcher.call(\"cellout\", obj, d)\n}\n\nconst d3_cellClick = (cellDispatcher, d, obj) => {\n  cellDispatcher.call(\"cellclick\", obj, d)\n}\n\nexport default {\n  d3_drawShapes: (\n    shape,\n    shapes,\n    shapeHeight,\n    shapeWidth,\n    shapeRadius,\n    path\n  ) => {\n    if (shape === \"rect\") {\n      shapes.attr(\"height\", shapeHeight).attr(\"width\", shapeWidth)\n    } else if (shape === \"circle\") {\n      shapes.attr(\"r\", shapeRadius)\n    } else if (shape === \"line\") {\n      shapes\n        .attr(\"x1\", 0)\n        .attr(\"x2\", shapeWidth)\n        .attr(\"y1\", 0)\n        .attr(\"y2\", 0)\n    } else if (shape === \"path\") {\n      shapes.attr(\"d\", path)\n    }\n  },\n\n  d3_addText: function(svg, enter, labels, classPrefix, labelWidth) {\n    enter.append(\"text\").attr(\"class\", classPrefix + \"label\")\n    const text = svg\n      .selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n      .data(labels)\n      .text(d3_identity)\n\n    if (labelWidth) {\n      svg\n        .selectAll(`g.${classPrefix}cell text.${classPrefix}label`)\n        .call(d3_textWrapping, labelWidth)\n    }\n\n    return text\n  },\n\n  d3_calcType: function(\n    scale,\n    ascending,\n    cells,\n    labels,\n    labelFormat,\n    labelDelimiter\n  ) {\n    const type = scale.invertExtent\n      ? d3_quantLegend(scale, labelFormat, labelDelimiter)\n      : scale.ticks\n        ? d3_linearLegend(scale, cells, labelFormat)\n        : d3_ordinalLegend(scale)\n\n    //for d3.scaleSequential that doesn't have a range function\n    const range = (scale.range && scale.range()) || scale.domain()\n    type.labels = d3_mergeLabels(\n      type.labels,\n      labels,\n      scale.domain(),\n      range,\n      labelDelimiter\n    )\n\n    if (ascending) {\n      type.labels = d3_reverse(type.labels)\n      type.data = d3_reverse(type.data)\n    }\n\n    return type\n  },\n\n  d3_filterCells: (type, cellFilter) => {\n    let filterCells = type.data\n      .map((d, i) => ({ data: d, label: type.labels[i] }))\n      .filter(cellFilter)\n    const dataValues = filterCells.map(d => d.data)\n    const labelValues = filterCells.map(d => d.label)\n    type.data = type.data.filter(d => dataValues.indexOf(d) !== -1)\n    type.labels = type.labels.filter(d => labelValues.indexOf(d) !== -1)\n    return type\n  },\n\n  d3_placement: (orient, cell, cellTrans, text, textTrans, labelAlign) => {\n    cell.attr(\"transform\", cellTrans)\n    text.attr(\"transform\", textTrans)\n    if (orient === \"horizontal\") {\n      text.style(\"text-anchor\", labelAlign)\n    }\n  },\n\n  d3_addEvents: function(cells, dispatcher) {\n    cells\n      .on(\"mouseover.legend\", function(d) {\n        d3_cellOver(dispatcher, d, this)\n      })\n      .on(\"mouseout.legend\", function(d) {\n        d3_cellOut(dispatcher, d, this)\n      })\n      .on(\"click.legend\", function(d) {\n        d3_cellClick(dispatcher, d, this)\n      })\n  },\n\n  d3_title: (svg, title, classPrefix, titleWidth) => {\n    if (title !== \"\") {\n      const titleText = svg.selectAll(\"text.\" + classPrefix + \"legendTitle\")\n\n      titleText\n        .data([title])\n        .enter()\n        .append(\"text\")\n        .attr(\"class\", classPrefix + \"legendTitle\")\n\n      svg.selectAll(\"text.\" + classPrefix + \"legendTitle\").text(title)\n\n      if (titleWidth) {\n        svg\n          .selectAll(\"text.\" + classPrefix + \"legendTitle\")\n          .call(d3_textWrapping, titleWidth)\n      }\n\n      const cellsSvg = svg.select(\".\" + classPrefix + \"legendCells\")\n      const yOffset = svg\n          .select(\".\" + classPrefix + \"legendTitle\")\n          .nodes()\n          .map(d => d.getBBox().height)[0],\n        xOffset = -cellsSvg.nodes().map(function(d) {\n          return d.getBBox().x\n        })[0]\n      cellsSvg.attr(\"transform\", \"translate(\" + xOffset + \",\" + yOffset + \")\")\n    }\n  },\n\n  d3_defaultLocale: {\n    format,\n    formatPrefix\n  },\n\n  d3_defaultFormatSpecifier: \".01f\",\n\n  d3_defaultDelimiter: \"to\"\n}\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\n\nimport { sum } from \"d3-array\"\n\nexport default function color() {\n  let scale = scaleLinear(),\n    shape = \"rect\",\n    shapeWidth = 15,\n    shapeHeight = 15,\n    shapeRadius = 10,\n    shapePadding = 2,\n    cells = [5],\n    cellFilter,\n    labels = [],\n    classPrefix = \"\",\n    useClass = false,\n    title = \"\",\n    locale = helper.d3_defaultLocale,\n    specifier = helper.d3_defaultFormatSpecifier,\n    labelOffset = 10,\n    labelAlign = \"middle\",\n    labelDelimiter = helper.d3_defaultDelimiter,\n    labelWrap,\n    orient = \"vertical\",\n    ascending = false,\n    path,\n    titleWidth,\n    legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n  function legend(svg) {\n    const type = helper.d3_calcType(\n        scale,\n        ascending,\n        cells,\n        labels,\n        locale.format(specifier),\n        labelDelimiter\n      ),\n      legendG = svg.selectAll(\"g\").data([scale])\n\n    legendG\n      .enter()\n      .append(\"g\")\n      .attr(\"class\", classPrefix + \"legendCells\")\n\n    if (cellFilter) {\n      helper.d3_filterCells(type, cellFilter)\n    }\n\n    let cell = svg\n      .select(\".\" + classPrefix + \"legendCells\")\n      .selectAll(\".\" + classPrefix + \"cell\")\n      .data(type.data)\n\n    const cellEnter = cell\n      .enter()\n      .append(\"g\")\n      .attr(\"class\", classPrefix + \"cell\")\n    cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n    let shapes = svg\n      .selectAll(\n        \"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\"\n      )\n      .data(type.data)\n\n    //add event handlers\n    helper.d3_addEvents(cellEnter, legendDispatcher)\n\n    cell\n      .exit()\n      .transition()\n      .style(\"opacity\", 0)\n      .remove()\n    shapes\n      .exit()\n      .transition()\n      .style(\"opacity\", 0)\n      .remove()\n\n    shapes = shapes.merge(shapes)\n\n    helper.d3_drawShapes(\n      shape,\n      shapes,\n      shapeHeight,\n      shapeWidth,\n      shapeRadius,\n      path\n    )\n    const text = helper.d3_addText(\n      svg,\n      cellEnter,\n      type.labels,\n      classPrefix,\n      labelWrap\n    )\n\n    // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n    cell = cellEnter.merge(cell)\n\n    // sets placement\n    const textSize = text.nodes().map(d => d.getBBox()),\n      shapeSize = shapes.nodes().map(d => d.getBBox())\n    //sets scale\n    //everything is fill except for line which is stroke,\n    if (!useClass) {\n      if (shape == \"line\") {\n        shapes.style(\"stroke\", type.feature)\n      } else {\n        shapes.style(\"fill\", type.feature)\n      }\n    } else {\n      shapes.attr(\"class\", d => `${classPrefix}swatch ${type.feature(d)}`)\n    }\n\n    let cellTrans,\n      textTrans,\n      textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n    //positions cells and text\n    if (orient === \"vertical\") {\n      const cellSize = textSize.map((d, i) =>\n        Math.max(d.height, shapeSize[i].height)\n      )\n\n      cellTrans = (d, i) => {\n        const height = sum(cellSize.slice(0, i))\n        return `translate(0, ${height + i * shapePadding})`\n      }\n\n      textTrans = (d, i) =>\n        `translate( ${shapeSize[i].width +\n          shapeSize[i].x +\n          labelOffset}, ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n    } else if (orient === \"horizontal\") {\n      cellTrans = (d, i) =>\n        `translate(${i * (shapeSize[i].width + shapePadding)},0)`\n      textTrans = (d, i) => `translate(${shapeSize[i].width * textAlign +\n        shapeSize[i].x},\n          ${shapeSize[i].height + shapeSize[i].y + labelOffset + 8})`\n    }\n\n    helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n    helper.d3_title(svg, title, classPrefix, titleWidth)\n\n    cell.transition().style(\"opacity\", 1)\n  }\n\n  legend.scale = function(_) {\n    if (!arguments.length) return scale\n    scale = _\n    return legend\n  }\n\n  legend.cells = function(_) {\n    if (!arguments.length) return cells\n    if (_.length > 1 || _ >= 2) {\n      cells = _\n    }\n    return legend\n  }\n\n  legend.cellFilter = function(_) {\n    if (!arguments.length) return cellFilter\n    cellFilter = _\n    return legend\n  }\n\n  legend.shape = function(_, d) {\n    if (!arguments.length) return shape\n    if (\n      _ == \"rect\" ||\n      _ == \"circle\" ||\n      _ == \"line\" ||\n      (_ == \"path\" && typeof d === \"string\")\n    ) {\n      shape = _\n      path = d\n    }\n    return legend\n  }\n\n  legend.shapeWidth = function(_) {\n    if (!arguments.length) return shapeWidth\n    shapeWidth = +_\n    return legend\n  }\n\n  legend.shapeHeight = function(_) {\n    if (!arguments.length) return shapeHeight\n    shapeHeight = +_\n    return legend\n  }\n\n  legend.shapeRadius = function(_) {\n    if (!arguments.length) return shapeRadius\n    shapeRadius = +_\n    return legend\n  }\n\n  legend.shapePadding = function(_) {\n    if (!arguments.length) return shapePadding\n    shapePadding = +_\n    return legend\n  }\n\n  legend.labels = function(_) {\n    if (!arguments.length) return labels\n    labels = _\n    return legend\n  }\n\n  legend.labelAlign = function(_) {\n    if (!arguments.length) return labelAlign\n    if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n      labelAlign = _\n    }\n    return legend\n  }\n\n  legend.locale = function(_) {\n    if (!arguments.length) return locale\n    locale = formatLocale(_)\n    return legend\n  }\n\n  legend.labelFormat = function(_) {\n    if (!arguments.length) return legend.locale().format(specifier)\n    specifier = formatSpecifier(_)\n    return legend\n  }\n\n  legend.labelOffset = function(_) {\n    if (!arguments.length) return labelOffset\n    labelOffset = +_\n    return legend\n  }\n\n  legend.labelDelimiter = function(_) {\n    if (!arguments.length) return labelDelimiter\n    labelDelimiter = _\n    return legend\n  }\n\n  legend.labelWrap = function(_) {\n    if (!arguments.length) return labelWrap\n    labelWrap = _\n    return legend\n  }\n\n  legend.useClass = function(_) {\n    if (!arguments.length) return useClass\n    if (_ === true || _ === false) {\n      useClass = _\n    }\n    return legend\n  }\n\n  legend.orient = function(_) {\n    if (!arguments.length) return orient\n    _ = _.toLowerCase()\n    if (_ == \"horizontal\" || _ == \"vertical\") {\n      orient = _\n    }\n    return legend\n  }\n\n  legend.ascending = function(_) {\n    if (!arguments.length) return ascending\n    ascending = !!_\n    return legend\n  }\n\n  legend.classPrefix = function(_) {\n    if (!arguments.length) return classPrefix\n    classPrefix = _\n    return legend\n  }\n\n  legend.title = function(_) {\n    if (!arguments.length) return title\n    title = _\n    return legend\n  }\n\n  legend.titleWidth = function(_) {\n    if (!arguments.length) return titleWidth\n    titleWidth = _\n    return legend\n  }\n\n  legend.textWrap = function(_) {\n    if (!arguments.length) return textWrap\n    textWrap = _\n    return legend\n  }\n\n  legend.on = function() {\n    const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n    return value === legendDispatcher ? legend : value\n  }\n\n  return legend\n}\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function size() {\n  let scale = scaleLinear(),\n    shape = \"rect\",\n    shapeWidth = 15,\n    shapePadding = 2,\n    cells = [5],\n    cellFilter,\n    labels = [],\n    classPrefix = \"\",\n    title = \"\",\n    locale = helper.d3_defaultLocale,\n    specifier = helper.d3_defaultFormatSpecifier,\n    labelOffset = 10,\n    labelAlign = \"middle\",\n    labelDelimiter = helper.d3_defaultDelimiter,\n    labelWrap,\n    orient = \"vertical\",\n    ascending = false,\n    path,\n    titleWidth,\n    legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n  function legend(svg) {\n    const type = helper.d3_calcType(\n        scale,\n        ascending,\n        cells,\n        labels,\n        locale.format(specifier),\n        labelDelimiter\n      ),\n      legendG = svg.selectAll(\"g\").data([scale])\n\n    if (cellFilter) {\n      helper.d3_filterCells(type, cellFilter)\n    }\n\n    legendG\n      .enter()\n      .append(\"g\")\n      .attr(\"class\", classPrefix + \"legendCells\")\n\n    let cell = svg\n      .select(\".\" + classPrefix + \"legendCells\")\n      .selectAll(\".\" + classPrefix + \"cell\")\n      .data(type.data)\n    const cellEnter = cell\n      .enter()\n      .append(\"g\")\n      .attr(\"class\", classPrefix + \"cell\")\n    cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n    let shapes = svg.selectAll(\n      \"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\"\n    )\n\n    //add event handlers\n    helper.d3_addEvents(cellEnter, legendDispatcher)\n\n    cell\n      .exit()\n      .transition()\n      .style(\"opacity\", 0)\n      .remove()\n\n    shapes\n      .exit()\n      .transition()\n      .style(\"opacity\", 0)\n      .remove()\n    shapes = shapes.merge(shapes)\n\n    //creates shape\n    if (shape === \"line\") {\n      helper.d3_drawShapes(shape, shapes, 0, shapeWidth)\n      shapes.attr(\"stroke-width\", type.feature)\n    } else {\n      helper.d3_drawShapes(\n        shape,\n        shapes,\n        type.feature,\n        type.feature,\n        type.feature,\n        path\n      )\n    }\n\n    const text = helper.d3_addText(\n      svg,\n      cellEnter,\n      type.labels,\n      classPrefix,\n      labelWrap\n    )\n\n    // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n    cell = cellEnter.merge(cell)\n\n    //sets placement\n\n    const textSize = text.nodes().map(d => d.getBBox()),\n      shapeSize = shapes.nodes().map((d, i) => {\n        const bbox = d.getBBox()\n        const stroke = scale(type.data[i])\n\n        if (shape === \"line\" && orient === \"horizontal\") {\n          bbox.height = bbox.height + stroke\n        } else if (shape === \"line\" && orient === \"vertical\") {\n          bbox.width = bbox.width\n        }\n        return bbox\n      })\n\n    const maxH = max(shapeSize, d => d.height + d.y),\n      maxW = max(shapeSize, d => d.width + d.x)\n\n    let cellTrans,\n      textTrans,\n      textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n    //positions cells and text\n    if (orient === \"vertical\") {\n      const cellSize = textSize.map((d, i) =>\n        Math.max(d.height, shapeSize[i].height)\n      )\n      const y =\n        shape == \"circle\" || shape == \"line\" ? shapeSize[0].height / 2 : 0\n      cellTrans = (d, i) => {\n        const height = sum(cellSize.slice(0, i))\n\n        return `translate(0, ${y + height + i * shapePadding})`\n      }\n\n      textTrans = (d, i) => `translate( ${maxW + labelOffset},\n          ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n    } else if (orient === \"horizontal\") {\n      cellTrans = (d, i) => {\n        const width = sum(shapeSize.slice(0, i), d => d.width)\n        const y = shape == \"circle\" || shape == \"line\" ? maxH / 2 : 0\n        return `translate(${width + i * shapePadding}, ${y})`\n      }\n\n      const offset = shape == \"line\" ? maxH / 2 : maxH\n      textTrans = (d, i) => {\n        return `translate( ${shapeSize[i].width * textAlign + shapeSize[i].x},\n              ${offset + labelOffset})`\n      }\n    }\n\n    helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n    helper.d3_title(svg, title, classPrefix, titleWidth)\n\n    cell.transition().style(\"opacity\", 1)\n  }\n\n  legend.scale = function(_) {\n    if (!arguments.length) return scale\n    scale = _\n    return legend\n  }\n\n  legend.cells = function(_) {\n    if (!arguments.length) return cells\n    if (_.length > 1 || _ >= 2) {\n      cells = _\n    }\n    return legend\n  }\n\n  legend.cellFilter = function(_) {\n    if (!arguments.length) return cellFilter\n    cellFilter = _\n    return legend\n  }\n\n  legend.shape = function(_, d) {\n    if (!arguments.length) return shape\n    if (_ == \"rect\" || _ == \"circle\" || _ == \"line\") {\n      shape = _\n      path = d\n    }\n    return legend\n  }\n\n  legend.shapeWidth = function(_) {\n    if (!arguments.length) return shapeWidth\n    shapeWidth = +_\n    return legend\n  }\n\n  legend.shapePadding = function(_) {\n    if (!arguments.length) return shapePadding\n    shapePadding = +_\n    return legend\n  }\n\n  legend.labels = function(_) {\n    if (!arguments.length) return labels\n    labels = _\n    return legend\n  }\n\n  legend.labelAlign = function(_) {\n    if (!arguments.length) return labelAlign\n    if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n      labelAlign = _\n    }\n    return legend\n  }\n\n  legend.locale = function(_) {\n    if (!arguments.length) return locale\n    locale = formatLocale(_)\n    return legend\n  }\n\n  legend.labelFormat = function(_) {\n    if (!arguments.length) return legend.locale().format(specifier)\n    specifier = formatSpecifier(_)\n    return legend\n  }\n\n  legend.labelOffset = function(_) {\n    if (!arguments.length) return labelOffset\n    labelOffset = +_\n    return legend\n  }\n\n  legend.labelDelimiter = function(_) {\n    if (!arguments.length) return labelDelimiter\n    labelDelimiter = _\n    return legend\n  }\n\n  legend.labelWrap = function(_) {\n    if (!arguments.length) return labelWrap\n    labelWrap = _\n    return legend\n  }\n\n  legend.orient = function(_) {\n    if (!arguments.length) return orient\n    _ = _.toLowerCase()\n    if (_ == \"horizontal\" || _ == \"vertical\") {\n      orient = _\n    }\n    return legend\n  }\n\n  legend.ascending = function(_) {\n    if (!arguments.length) return ascending\n    ascending = !!_\n    return legend\n  }\n\n  legend.classPrefix = function(_) {\n    if (!arguments.length) return classPrefix\n    classPrefix = _\n    return legend\n  }\n\n  legend.title = function(_) {\n    if (!arguments.length) return title\n    title = _\n    return legend\n  }\n\n  legend.titleWidth = function(_) {\n    if (!arguments.length) return titleWidth\n    titleWidth = _\n    return legend\n  }\n\n  legend.on = function() {\n    const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n    return value === legendDispatcher ? legend : value\n  }\n\n  return legend\n}\n","import helper from \"./legend\"\nimport { dispatch } from \"d3-dispatch\"\nimport { scaleLinear } from \"d3-scale\"\nimport { formatLocale, formatSpecifier } from \"d3-format\"\nimport { sum, max } from \"d3-array\"\n\nexport default function symbol() {\n  let scale = scaleLinear(),\n    shape = \"path\",\n    shapeWidth = 15,\n    shapeHeight = 15,\n    shapeRadius = 10,\n    shapePadding = 5,\n    cells = [5],\n    cellFilter,\n    labels = [],\n    classPrefix = \"\",\n    title = \"\",\n    locale = helper.d3_defaultLocale,\n    specifier = helper.d3_defaultFormatSpecifier,\n    labelAlign = \"middle\",\n    labelOffset = 10,\n    labelDelimiter = helper.d3_defaultDelimiter,\n    labelWrap,\n    orient = \"vertical\",\n    ascending = false,\n    titleWidth,\n    legendDispatcher = dispatch(\"cellover\", \"cellout\", \"cellclick\")\n\n  function legend(svg) {\n    const type = helper.d3_calcType(\n        scale,\n        ascending,\n        cells,\n        labels,\n        locale.format(specifier),\n        labelDelimiter\n      ),\n      legendG = svg.selectAll(\"g\").data([scale])\n\n    if (cellFilter) {\n      helper.d3_filterCells(type, cellFilter)\n    }\n\n    legendG\n      .enter()\n      .append(\"g\")\n      .attr(\"class\", classPrefix + \"legendCells\")\n\n    let cell = svg\n      .select(\".\" + classPrefix + \"legendCells\")\n      .selectAll(\".\" + classPrefix + \"cell\")\n      .data(type.data)\n    const cellEnter = cell\n      .enter()\n      .append(\"g\")\n      .attr(\"class\", classPrefix + \"cell\")\n    cellEnter.append(shape).attr(\"class\", classPrefix + \"swatch\")\n\n    let shapes = svg.selectAll(\"g.\" + classPrefix + \"cell \" + shape + \".\" + classPrefix + \"swatch\")\n\n    //add event handlers\n    helper.d3_addEvents(cellEnter, legendDispatcher)\n\n    //remove old shapes\n    cell\n      .exit()\n      .transition()\n      .style(\"opacity\", 0)\n      .remove()\n    shapes\n      .exit()\n      .transition()\n      .style(\"opacity\", 0)\n      .remove()\n    shapes = shapes.merge(shapes)\n\n    helper.d3_drawShapes(\n      shape,\n      shapes,\n      shapeHeight,\n      shapeWidth,\n      shapeRadius,\n      type.feature\n    )\n    const text = helper.d3_addText(\n      svg,\n      cellEnter,\n      type.labels,\n      classPrefix,\n      labelWrap\n    )\n\n    // we need to merge the selection, otherwise changes in the legend (e.g. change of orientation) are applied only to the new cells and not the existing ones.\n    cell = cellEnter.merge(cell)\n\n    // sets placement\n    const textSize = text.nodes().map(d => d.getBBox()),\n      shapeSize = shapes.nodes().map(d => d.getBBox())\n\n    const maxH = max(shapeSize, d => d.height),\n      maxW = max(shapeSize, d => d.width)\n\n    let cellTrans,\n      textTrans,\n      textAlign = labelAlign == \"start\" ? 0 : labelAlign == \"middle\" ? 0.5 : 1\n\n    //positions cells and text\n    if (orient === \"vertical\") {\n      const cellSize = textSize.map((d, i) => Math.max(maxH, d.height))\n\n      cellTrans = (d, i) => {\n        const height = sum(cellSize.slice(0, i))\n        return `translate(0, ${height + i * shapePadding} )`\n      }\n      textTrans = (d, i) => `translate( ${maxW + labelOffset},\n              ${shapeSize[i].y + shapeSize[i].height / 2 + 5})`\n    } else if (orient === \"horizontal\") {\n      cellTrans = (d, i) => `translate( ${i * (maxW + shapePadding)},0)`\n      textTrans = (d, i) => `translate( ${shapeSize[i].width * textAlign +\n        shapeSize[i].x},\n              ${maxH + labelOffset})`\n    }\n\n    helper.d3_placement(orient, cell, cellTrans, text, textTrans, labelAlign)\n    helper.d3_title(svg, title, classPrefix, titleWidth)\n    cell.transition().style(\"opacity\", 1)\n  }\n\n  legend.scale = function(_) {\n    if (!arguments.length) return scale\n    scale = _\n    return legend\n  }\n\n  legend.cells = function(_) {\n    if (!arguments.length) return cells\n    if (_.length > 1 || _ >= 2) {\n      cells = _\n    }\n    return legend\n  }\n\n  legend.cellFilter = function(_) {\n    if (!arguments.length) return cellFilter\n    cellFilter = _\n    return legend\n  }\n\n  legend.shapePadding = function(_) {\n    if (!arguments.length) return shapePadding\n    shapePadding = +_\n    return legend\n  }\n\n  legend.labels = function(_) {\n    if (!arguments.length) return labels\n    labels = _\n    return legend\n  }\n\n  legend.labelAlign = function(_) {\n    if (!arguments.length) return labelAlign\n    if (_ == \"start\" || _ == \"end\" || _ == \"middle\") {\n      labelAlign = _\n    }\n    return legend\n  }\n\n  legend.locale = function(_) {\n    if (!arguments.length) return locale\n    locale = formatLocale(_)\n    return legend\n  }\n\n  legend.labelFormat = function(_) {\n    if (!arguments.length) return legend.locale().format(specifier)\n    specifier = formatSpecifier(_)\n    return legend\n  }\n\n  legend.labelOffset = function(_) {\n    if (!arguments.length) return labelOffset\n    labelOffset = +_\n    return legend\n  }\n\n  legend.labelDelimiter = function(_) {\n    if (!arguments.length) return labelDelimiter\n    labelDelimiter = _\n    return legend\n  }\n\n  legend.labelWrap = function(_) {\n    if (!arguments.length) return labelWrap\n    labelWrap = _\n    return legend\n  }\n\n  legend.orient = function(_) {\n    if (!arguments.length) return orient\n    _ = _.toLowerCase()\n    if (_ == \"horizontal\" || _ == \"vertical\") {\n      orient = _\n    }\n    return legend\n  }\n\n  legend.ascending = function(_) {\n    if (!arguments.length) return ascending\n    ascending = !!_\n    return legend\n  }\n\n  legend.classPrefix = function(_) {\n    if (!arguments.length) return classPrefix\n    classPrefix = _\n    return legend\n  }\n\n  legend.title = function(_) {\n    if (!arguments.length) return title\n    title = _\n    return legend\n  }\n\n  legend.titleWidth = function(_) {\n    if (!arguments.length) return titleWidth\n    titleWidth = _\n    return legend\n  }\n\n  legend.on = function() {\n    const value = legendDispatcher.on.apply(legendDispatcher, arguments)\n    return value === legendDispatcher ? legend : value\n  }\n\n  return legend\n}\n","export const thresholdLabels = function({\n  i,\n  genLength,\n  generatedLabels,\n  labelDelimiter\n}) {\n  if (i === 0) {\n    const values = generatedLabels[i].split(` ${labelDelimiter} `)\n    return `Less than ${values[1]}`\n  } else if (i === genLength - 1) {\n    const values = generatedLabels[i].split(` ${labelDelimiter} `)\n    return `${values[0]} or more`\n  }\n  return generatedLabels[i]\n}\n\nexport default {\n  thresholdLabels\n}\n","import legendColor from './src/color'\nimport legendSize from './src/size'\nimport legendSymbol from './src/symbol'\nimport legendHelpers from './src/helpers'\n\nexport { legendColor, legendSize, legendSymbol, legendHelpers }\n\nexport default {\n  legendColor,\n  legendSize,\n  legendSymbol,\n  legendHelpers\n};\n"]}