Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(VSparkline): Initial component migration #18659

Merged
merged 12 commits into from
Feb 21, 2024
Merged

Conversation

blalan05
Copy link
Member

@blalan05 blalan05 commented Nov 12, 2023

<template>
  <v-container fluid>
    <v-sparkline
      :fill="fill"
      :gradient="selectedGradient"
      :line-width="width"
      :padding="padding"
      :smooth="radius || false"
      :model-value="value"
      auto-draw
      type="bar"
    />
    <v-sparkline
      :fill="fill"
      :gradient="selectedGradient"
      :line-width="width"
      :padding="padding"
      :smooth="radius || false"
      :model-value="value"
      auto-draw
    />

    <v-divider />

    <v-row>
      <v-col
        cols="12"
        md="6"
      >
        <v-row
          class="fill-height"
          align="center"
        >
          <v-item-group
            v-model="selectedGradient"
            mandatory
          >
            <v-row>
              <v-item
                v-for="(gradient, i) in gradients"
                :key="i"
                v-slot="{ active, toggle }"
                :value="gradient"
              >
                <v-card
                  :style="{
                    background: gradient.length > 1
                      ? `linear-gradient(180deg, ${gradient})`
                      : gradient[0],
                    border: '2px solid',
                    borderColor: active ? '#222' : 'white'
                  }"
                  width="30"
                  height="30"
                  class="me-2"
                  @click="toggle"
                />
              </v-item>
            </v-row>
          </v-item-group>
        </v-row>
      </v-col>

      <v-col
        cols="12"
        md="6"
      >
        <v-slider
          v-model="width"
          label="Width"
          min="0.1"
          max="10"
          step="0.1"
          thumb-label
        />
      </v-col>

      <v-col cols="6">
        <v-row
          class="fill-height"
          align="center"
        >
          <v-switch
            v-model="fill"
            label="Filled"
          />
        </v-row>
      </v-col>

      <v-col
        cols="12"
        md="6"
      >
        <v-slider
          v-model="radius"
          label="Radius"
          min="0"
          max="25"
          thumb-label
        />
      </v-col>

      <v-col
        cols="12"
        md="6"
        offset-md="6"
      >
        <v-slider
          v-model="padding"
          label="Padding"
          min="0"
          max="25"
          thumb-label
        />
      </v-col>
    </v-row>
  </v-container>
</template>
<script setup>
  import { ref } from 'vue'

  const gradients = [
    ['#222'],
    ['#42b3f4'],
    ['red', 'orange', 'yellow'],
    ['purple', 'violet'],
    ['#00c6ff', '#F0F', '#FF0'],
    ['#f72047', '#ffd200', '#1feaea'],
  ]
  const fill = ref(true)
  const selectedGradient = ref(gradients[4])
  const padding = ref(8)
  const radius = ref(10)
  const value = ref([0, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0])
  const width = ref(2)
</script>

@blalan05 blalan05 self-assigned this Nov 12, 2023
@blalan05 blalan05 added C: VSparkline VSparkline T: feature A new feature labels Nov 12, 2023
@johnleider johnleider force-pushed the feat/v3-sparkline branch 2 times, most recently from 8591bd1 to 73c9568 Compare January 23, 2024 02:32
@johnleider johnleider changed the base branch from dev to master January 23, 2024 02:32
@KaelWD KaelWD force-pushed the master branch 3 times, most recently from cd170f8 to 98e57dc Compare February 14, 2024 06:14
@johnleider johnleider marked this pull request as ready for review February 21, 2024 21:44
@johnleider johnleider added this to the v3.5.x milestone Feb 21, 2024
@johnleider johnleider merged commit 09004a0 into master Feb 21, 2024
17 of 18 checks passed
@johnleider johnleider deleted the feat/v3-sparkline branch February 21, 2024 21:46
@johnleider johnleider mentioned this pull request Feb 21, 2024
VIXI0 pushed a commit to VIXI0/vuetify that referenced this pull request Mar 13, 2024
Co-authored-by: John Leider <john@vuetifyjs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VSparkline VSparkline labs T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants