<commit_before><template>
  <tap-section class="chart-section">
    <h1>정수장 수질 정보</h1>
    <h3>
      {{ name }}
      <h5>{{ juso }}</h5>
    </h3>

    <canvas ref="tb"></canvas>
    <canvas ref="ph"></canvas>
    <canvas ref="cl"></canvas>
  </tap-section>
</template>

<style scoped>
  .chart-section {
    background: #eeeeee;

    & h1 {
      font-weight: 600;
    }

    & canvas {
      width: 100%;
      margin: 0 auto;
    }
  }
</style>

<script>
import axios from 'axios'
import moment from 'moment'
import Chart from 'chart.js'
import Geolocation from '../js/geolocation'
import TapSection from '../components/TapSection.vue'

const chartConfig = {
  type: 'line',

  options: {
    responsive: true,
    tooltips: {
      mode: 'index',
      intersect: false
    },
    hover: {
      mode: 'nearest',
      intersect: true
    },
    scales: {
      xAxes: [{
        display: true,
        scaleLabel: {
          display: true,
          labelString: 'Month'
        }
      }],
      yAxes: [{
        display: true,
        scaleLabel: {
          display: true,
          labelString: 'Value'
        }
      }]
    }
  }
}

const cloneConfig = (datasets, labels) =>
  Object.assign({ data: { labels, datasets } }, chartConfig)

export default {
  data: () => ({ name: 'Loading..', juso: '정수장 정보를 불러오는 중입니다...' }),
  async mounted () {
    const location = await Geolocation.getParsedPosition()

    const res = await axios.post('/facility', {
      location: [location.latitude, location.longitude]
    })

    const qualities = res.data.qualities
    const labels = qualities.map(q => moment(q.date).format('MM/DD'))
    const values = {
      tb: [
        {
          label: '탁도 (NTU)',
          backgroundColor: '#00adb5',
          borderColor: '#00adb5',
          data: qualities.map(v => v.tbVal),
          fill: false
        },

        {
          label: 'K-water 기준치',
          backgroundColor: 'rgba(128, 128, 128, .2)',
          borderColor: '#BBB',
          data: [...Array(qualities.length)].map(v => 0.05),<commit_msg>Update chart<commit_after><template>
  <tap-section class="chart-section">
    <h1>정수장 수질 정보</h1>
    <h3>
      {{ name }}
      <h5>{{ juso }}</h5>
    </h3>

    <canvas ref="tb"></canvas>
    <canvas ref="ph"></canvas>
    <canvas ref="cl"></canvas>
  </tap-section>
</template>

<style scoped>
  .chart-section {
    background: #eeeeee;

    & h1 {
      font-weight: 600;
    }

    & canvas {
      width: 100%;
      margin: 0 auto;
    }
  }
</style>

<script>
import axios from 'axios'
import moment from 'moment'
import Chart from 'chart.js'
import Geolocation from '../js/geolocation'
import TapSection from '../components/TapSection.vue'

const chartConfig = {
  type: 'line',

  options: {
    responsive: true,
    tooltips: {
      mode: 'index',
      intersect: false
    },
    hover: {
      mode: 'nearest',
      intersect: true
    },
    scales: {
      xAxes: [{
        display: true
      }],
      yAxes: [{
        display: true,
        scaleLabel: {
          display: true,
          labelString: 'Value'
        }
      }]
    }
  }
}

const cloneConfig = (datasets, labels) =>
  Object.assign({ data: { labels, datasets } }, chartConfig)

export default {
  data: () => ({ name: 'Loading..', juso: '정수장 정보를 불러오는 중입니다...' }),
  async mounted () {
    const location = await Geolocation.getParsedPosition()

    const res = await axios.post('/facility', {
      location: [location.latitude, location.longitude]
    })

    const qualities = res.data.qualities
    const labels = qualities.map(q => moment(q.date).format('MM/DD'))
    const values = {
      tb: [
        {
          label: '탁도 (NTU)',
          backgroundColor: '#00adb5',
          borderColor: '#00adb5',
          data: qualities.map(v => v.tbVal),
          fill: false
        },

        {
          label: '5-Star 수준 수질',
          backgroundColor: 'rgba(128, 128, 128, .2)',
          borderColor: '#BBB',
          data: [...Array(qualities.length)].map(v => 0.05),
          fill: 'origin'
        },

        {
          label: 'K-water 목표 수질',
          backgroundColor: 'rgba(128, 128, 128, .2)',
          borderColor: '#BBB',
          data: [...Array(qualities.length)].map(v => 0.1),
{'fraction_non_alphanumeric': 0.16107854630715124, 'fraction_numerical': 0.018522860492379837, 'mean_word_length': 2.0, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 52, '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': '4910516', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1487, 'n_words': 326}