<commit_before>import {svg} from '@cycle/dom';

import {gates, wires, clipPaths} from './gates';
import './index.styl';

const render = (state) =>
  svg('g',[
    clipPaths(3000),
    state.circuit.gates.map(({
      type,
      center, rotation, inputCount,
      soderInput,soderOutput, color,
      highlight, mayOmit,
    }, key) =>
      gates[type]({
        key,
        center, rotation, inputCount,
        soderInput, soderOutput, color,
        highlight, mayOmit,
      })
    ),
    state.circuit.wires.map(({
      type,
      from, toX, toY, input, inputCount,
      soderStart, soderEnd,
    }, key) =>
      wires[type]({
        key,
        from, toX, toY, input, inputCount,
        soderStart, soderEnd,
      })
    ),
    state.circuit.labels.map(({text, align, anchor}) =>
      svg('text', {
        key: 'label-' + text,
        x: anchor.x * 10,
        y: anchor.y * 10,
        'text-anchor': align,<commit_msg>use index as key value to work around virtual-dom bug<commit_after>import {svg} from '@cycle/dom';

import {gates, wires, clipPaths} from './gates';
import './index.styl';

const render = (state) =>
  svg('g',[
    clipPaths(3000),
    state.circuit.gates.map(({
      type,
      center, rotation, inputCount,
      soderInput,soderOutput, color,
      highlight, mayOmit,
    }, key) =>
      gates[type]({
        key,
        center, rotation, inputCount,
        soderInput, soderOutput, color,
        highlight, mayOmit,
      })
    ),
    state.circuit.wires.map(({
      type,
      from, toX, toY, input, inputCount,
      soderStart, soderEnd,
    }, key) =>
      wires[type]({
        key,
        from, toX, toY, input, inputCount,
        soderStart, soderEnd,
      })
    ),
    state.circuit.labels.map(({text, align, anchor}, i) =>
      svg('text', {
        key: 'label-' + i,
        x: anchor.x * 10,
        y: anchor.y * 10,
        'text-anchor': align,
{'fraction_non_alphanumeric': 0.153125, 'fraction_numerical': 0.008333333333333333, 'mean_word_length': 2.138888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2624607', 'n_tokens_mistral': 676, 'n_tokens_neox': 649, 'n_words': 151}