Sha256: c93bc97e68ed8312c6821bd905b277633691f52e45ad3fa6d3fe0676b552838c

Contents?: true

Size: 920 Bytes

Versions: 5

Compression:

Stored size: 920 Bytes

Contents

// eslint-disable-next-line no-unused-vars
function CurriculumMap(props) {
  const curriculum = props.results;
  const min = Math.min(...curriculum.module_sizes),
    max = Math.max(...curriculum.module_sizes);

  // eslint-disable-next-line no-undef
  const scale = _.curry(scaleNumber)(70, 100, min, max);
  const colorCode = colorCodeCss(curriculum.resource.subject, curriculum.resource.grade);

  const modules = curriculum.module_sizes.map((size, i) => {
    const styles = { width: `${scale(size)}%` };
    const module = curriculum.children[i];
    return (
      <CurriculumMapModule blank={!!props.links_new_tab}
        key={i}
        styles={styles}
        curriculum={module}
        colorCode={colorCode}
        mapType={props.mapType}
        subject={curriculum.resource.subject}
        active={props.active} />
    );
  });

  return (
    <div className="o-c-map">
      {modules}
    </div>
  );
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lcms-engine-0.1.4 app/assets/javascripts/lcms/engine/components/curriculum-map/CurriculumMap.js.jsx
lcms-engine-0.1.3 app/assets/javascripts/lcms/engine/components/curriculum-map/CurriculumMap.js.jsx
lcms-engine-0.2.0 app/assets/javascripts/lcms/engine/components/curriculum-map/CurriculumMap.js.jsx
lcms-engine-0.1.2 app/assets/javascripts/lcms/engine/components/curriculum-map/CurriculumMap.js.jsx
lcms-engine-0.1.0 app/assets/javascripts/lcms/engine/components/curriculum-map/CurriculumMap.js.jsx