Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
@ -1 +0,0 @@
|
||||
I have updated the search bar style to match the image you provided. Please review the changes.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 308 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -15,9 +15,6 @@
|
||||
{% endif %}
|
||||
{% load static %}
|
||||
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="https://unpkg.com/heroicons@2.1.3/24/outline/index.js"></script>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
|
||||
@ -1,268 +1,145 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}ComplianceShield Dashboard{% endblock %}
|
||||
{% block title %}{{ project_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% block head %}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--ink: #0b0b0c;
|
||||
--paper: #fbfaf7;
|
||||
--line: rgba(11, 11, 12, .08);
|
||||
--shadow: 0 18px 48px rgba(11, 11, 12, .10);
|
||||
--shadow2: 0 10px 26px rgba(11, 11, 12, .10);
|
||||
--radius: 22px;
|
||||
--blue: #2563eb;
|
||||
--blue2: #60a5fa;
|
||||
--ice: #eaf2ff;
|
||||
--ice2: #f6fbff;
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: var(--ink);
|
||||
background-color: #f7f9fc;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.panel {
|
||||
border-radius: var(--radius);
|
||||
background: white;
|
||||
border: 1px solid var(--line);
|
||||
box-shadow: var(--shadow2);
|
||||
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
.chip {
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--line);
|
||||
background: #f8f9fa;
|
||||
|
||||
@keyframes bg-pan {
|
||||
0% {
|
||||
background-position: 0% 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2.5rem 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
|
||||
font-weight: 700;
|
||||
margin: 0 0 1.2rem;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.loader {
|
||||
margin: 1.5rem auto;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.runtime code {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
padding: 0.15rem 0.45rem;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 0.85rem;
|
||||
opacity: 0.75;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="flex h-screen bg-gray-100">
|
||||
<!-- Sidebar -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col">
|
||||
<div class="p-6">
|
||||
<a href="#" class="flex items-center gap-3">
|
||||
<div class="h-10 w-10 rounded-2xl bg-[#0b0b0c] text-white flex items-center justify-center text-sm font-semibold">CS</div>
|
||||
<div class="font-semibold tracking-tight">ComplianceShield</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<p class="px-6 text-xs text-gray-500 uppercase tracking-wider">Menu</p>
|
||||
<nav class="px-4 py-2 space-y-1">
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-gray-200 rounded-lg">
|
||||
🏠 Dashboard
|
||||
</a>
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
📊 Reports
|
||||
</a>
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
📅 Calendar
|
||||
</a>
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
👥 Teams
|
||||
</a>
|
||||
</nav>
|
||||
<p class="px-6 mt-4 text-xs text-gray-500 uppercase tracking-wider">Projects</p>
|
||||
<nav class="px-4 py-2 space-y-1">
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
🟦 Ongoing
|
||||
</a>
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
✅ Completed
|
||||
</a>
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
⏸️ On Hold
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div class="p-4 bg-gray-100 rounded-lg text-center">
|
||||
<p class="text-sm font-medium">Ready to launch a new project?</p>
|
||||
<p class="text-xs text-gray-600 mt-1">Create a new jobsite and start tracking compliance today.</p>
|
||||
<button class="mt-3 w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-semibold">Add New Project</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-200">
|
||||
<nav class="px-4 py-4 space-y-1">
|
||||
<a href="/admin" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
⚙️ Settings
|
||||
</a>
|
||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||
🛟 Help Center
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main content -->
|
||||
<main class="flex-1 p-6 lg:p-10 overflow-y-auto">
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-2xl font-semibold text-gray-800">ComplianceShield Dashboard</h1>
|
||||
<div class="flex-1 flex justify-center px-8">
|
||||
<div class="relative w-full max-w-lg">
|
||||
<span class="absolute inset-y-0 left-0 flex items-center pl-3">
|
||||
<i-o-magnifying-glass class="h-5 w-5 text-gray-500"></i-o-magnifying-glass>
|
||||
</span>
|
||||
<input type="text" placeholder="Search..." class="block w-full rounded-md border border-gray-200 bg-gray-50 py-2 pl-10 pr-4 text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:text-sm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<i-o-bell class="h-6 w-6 text-gray-500"></i-o-bell>
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="h-8 w-8 rounded-full bg-gray-400"></div>
|
||||
<div>
|
||||
<p class="font-semibold text-sm">Owner</p>
|
||||
<p class="text-xs text-gray-500">Your Account Menu</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel p-6 mb-8">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<h2 class="text-lg font-semibold">Ready to launch a new project?</h2>
|
||||
<p class="text-sm text-gray-500">Create a new jobsite and start tracking compliance today.</p>
|
||||
</div>
|
||||
<button class="bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-semibold">Add New Project</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mt-6">
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 col-span-2">
|
||||
<div class="panel p-6">
|
||||
<h3 class="text-sm font-semibold text-gray-500 flex items-center gap-2"><span class="h-2 w-2 bg-blue-500 rounded-full"></span> Ongoing Projects</h3>
|
||||
<p class="text-3xl font-bold mt-2">08</p>
|
||||
<p class="text-sm text-green-500">+3.0% From last month</p>
|
||||
</div>
|
||||
<div class="panel p-6">
|
||||
<h3 class="text-sm font-semibold text-gray-500 flex items-center gap-2"><span class="h-2 w-2 bg-green-500 rounded-full"></span> Complete Projects</h3>
|
||||
<p class="text-3xl font-bold mt-2">30</p>
|
||||
<p class="text-sm text-red-500">-5.0% From last month</p>
|
||||
</div>
|
||||
<div class="panel p-6">
|
||||
<h3 class="text-sm font-semibold text-gray-500 flex items-center gap-2"><span class="h-2 w-2 bg-gray-400 rounded-full"></span> On Hold Projects</h3>
|
||||
<p class="text-3xl font-bold mt-2">03</p>
|
||||
<p class="text-sm text-green-500">+8.0% From last month</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel p-6 col-span-1">
|
||||
<h3 class="font-semibold mb-4">Alert Overview Live</h3>
|
||||
<div class="space-y-4">
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="h-8 w-8 bg-red-100 text-red-600 flex items-center justify-center rounded-full"><i-o-exclamation-triangle class="h-5 w-5"></i-o-exclamation-triangle></div>
|
||||
<div>
|
||||
<p class="font-semibold text-sm">Fraud / anomaly alert</p>
|
||||
<p class="text-xs text-gray-500">Project Manager — Eng. Rahim</p>
|
||||
<p class="text-xs text-gray-500">Habiganj 9746tr — Ongoing</p>
|
||||
<p class="text-xs mt-1">Material usage exceeded expected threshold.</p>
|
||||
<p class="text-xs text-gray-400 mt-1">5 hours ago</p>
|
||||
</div>
|
||||
<button class="text-xs text-blue-600 font-semibold">Mark as solved</button>
|
||||
</div>
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="h-8 w-8 bg-yellow-100 text-yellow-600 flex items-center justify-center rounded-full"><i-o-exclamation-circle class="h-5 w-5"></i-o-exclamation-circle></div>
|
||||
<div>
|
||||
<p class="font-semibold text-sm">COI expiring soon</p>
|
||||
<p class="text-xs text-gray-500">Subcontractor — R. Builders LLC</p>
|
||||
<p class="text-xs mt-1">Certificate of Insurance Expires in 7 days — request renewal.</p>
|
||||
<p class="text-xs text-gray-400 mt-1">Today</p>
|
||||
</div>
|
||||
<button class="text-xs text-blue-600 font-semibold">Send reminder</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mt-8">
|
||||
<div class="panel p-6 col-span-1">
|
||||
<h3 class="font-semibold">Projects Map Overview</h3>
|
||||
<div class="mt-4 bg-gray-200 rounded-lg h-48 flex items-center justify-center">
|
||||
<p class="text-gray-500">Mock map</p>
|
||||
</div>
|
||||
<ul class="mt-4 space-y-2 text-sm">
|
||||
<li class="flex items-center gap-2"><i-o-map-pin class="h-5 w-5 text-gray-400"></i-o-map-pin> Kukatata wt46tr</li>
|
||||
<li class="flex items-center gap-2"><i-o-map-pin class="h-5 w-5 text-gray-400"></i-o-map-pin> Habiganj 9746tr</li>
|
||||
<li class="flex items-center gap-2"><i-o-map-pin class="h-5 w-5 text-gray-400"></i-o-map-pin> Newmarket 746t</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel p-6 col-span-2">
|
||||
<h3 class="font-semibold">Habiganj 9746tr — Ongoing</h3>
|
||||
<div class="grid grid-cols-3 gap-4 text-sm mt-4">
|
||||
<div><p class="text-gray-500">Location</p><p>Dhaka, Bangladesh</p></div>
|
||||
<div><p class="text-gray-500">Planned</p><p>$2.5M</p></div>
|
||||
<div><p class="text-gray-500">Actual</p><p>$2.0M (-12%)</p></div>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<p class="text-gray-500 text-sm">Progress</p>
|
||||
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-1">
|
||||
<div class="bg-blue-600 h-2.5 rounded-full" style="width: 45%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="text-blue-600 font-semibold text-sm mt-4">View details</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mt-8">
|
||||
<div class="panel p-6 col-span-1">
|
||||
<h3 class="font-semibold">Compliance Status</h3>
|
||||
<div class="mt-4 space-y-4">
|
||||
<div>
|
||||
<p class="font-semibold">Daily Logs</p>
|
||||
<p class="text-gray-500 text-sm">On-time: 92%</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="font-semibold">Docs</p>
|
||||
<p class="text-gray-500 text-sm">Valid: 128 • Expiring: 7</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="font-semibold">Equipment</p>
|
||||
<p class="text-gray-500 text-sm">Maintenance due: 3</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="text-xl font-semibold">Daily Activity Log</h2>
|
||||
<div>
|
||||
<button class="chip px-4 py-2 text-sm font-semibold bg-white">Today</button>
|
||||
<button class="chip px-4 py-2 text-sm font-semibold">This week</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 space-y-4">
|
||||
<div class="panel p-6">
|
||||
<h3 class="font-semibold">Floor Slab</h3>
|
||||
<p class="text-sm text-gray-500">Project Manager — Eng. Rahim</p>
|
||||
<p class="text-xs text-gray-500">Habiganj 9746tr — Ongoing</p>
|
||||
<ul class="list-disc list-inside text-sm mt-2 space-y-1">
|
||||
<li>Ensure rebar spacing matches BOQ specification.</li>
|
||||
<li>Check curing process for foundation concrete.</li>
|
||||
<li>Verify column alignment before pouring.</li>
|
||||
</ul>
|
||||
<div class="flex justify-between items-center mt-4 text-sm text-gray-500">
|
||||
<span>Sep 17, 2025 — 06:45 PM</span>
|
||||
<span class="flex items-center gap-2"><i-o-photo class="h-5 w-5"></i-o-photo> 2 photos</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel p-6">
|
||||
<h3 class="font-semibold">Safety Meeting</h3>
|
||||
<p class="text-sm text-gray-500">Supervisor — T. Coleman</p>
|
||||
<p class="text-xs text-gray-500">Kukatata wt46tr — Ongoing</p>
|
||||
<ul class="list-disc list-inside text-sm mt-2 space-y-1">
|
||||
<li>Toolbox talk completed (PPE + ladder safety)</li>
|
||||
<li>Attendance captured with GPS check-in.</li>
|
||||
<li>PPE checklist verified (helmets, vests).</li>
|
||||
<li>Hazards documented with photo proof.</li>
|
||||
</ul>
|
||||
<div class="flex justify-between items-center mt-4 text-sm text-gray-500">
|
||||
<span>Sep 17, 2025 — 08:10 AM</span>
|
||||
<span class="flex items-center gap-2 text-green-600"><i-o-check-circle class="h-5 w-5"></i-o-check-circle> Completed</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your app…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
|
||||
<p class="runtime">
|
||||
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
|
||||
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
|
||||
</footer>
|
||||
{% endblock %}
|
||||
@ -1,7 +1,7 @@
|
||||
from django.urls import path
|
||||
|
||||
from .views import index
|
||||
from .views import home
|
||||
|
||||
urlpatterns = [
|
||||
path("", index, name="index"),
|
||||
path("", home, name="home"),
|
||||
]
|
||||
|
||||
@ -1,8 +1,25 @@
|
||||
import os
|
||||
import platform
|
||||
|
||||
from django import get_version as django_version
|
||||
from django.shortcuts import render
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
def index(request):
|
||||
def home(request):
|
||||
"""Render the landing screen with loader and environment details."""
|
||||
host_name = request.get_host().lower()
|
||||
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic"
|
||||
now = timezone.now()
|
||||
|
||||
context = {
|
||||
"project_name": "ComplianceShield",
|
||||
"project_name": "New Style",
|
||||
"agent_brand": agent_brand,
|
||||
"django_version": django_version(),
|
||||
"python_version": platform.python_version(),
|
||||
"current_time": now,
|
||||
"host_name": host_name,
|
||||
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
|
||||
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
|
||||
}
|
||||
return render(request, "core/index.html", context)
|
||||
|
||||
@ -1,54 +1,4 @@
|
||||
:root{
|
||||
--ink:#0b0b0c;
|
||||
--paper:#fbfaf7;
|
||||
--line: rgba(11,11,12,.08);
|
||||
--shadow: 0 18px 48px rgba(11,11,12,.10);
|
||||
--shadow2: 0 10px 26px rgba(11,11,12,.10);
|
||||
--radius: 22px;
|
||||
|
||||
/* premium blue theme (like the dashboard reference) */
|
||||
--blue:#2563eb;
|
||||
--blue2:#60a5fa;
|
||||
--ice:#eaf2ff;
|
||||
--ice2:#f6fbff;
|
||||
}
|
||||
|
||||
html, body { height: 100%; }
|
||||
body { font-family: 'Inter', sans-serif; color: var(--ink); }
|
||||
|
||||
.bg-premium{
|
||||
background:
|
||||
radial-gradient(1400px 560px at 18% 8%, rgba(96,165,250,.30), rgba(255,255,255,0) 60%),
|
||||
radial-gradient(1200px 520px at 92% 12%, rgba(37,99,235,.22), rgba(255,255,255,0) 55%),
|
||||
radial-gradient(1100px 620px at 55% 100%, rgba(234,242,255,.95), rgba(255,255,255,0) 60%),
|
||||
linear-gradient(180deg, #f6fbff 0%, #ffffff 55%, #f7fbff 100%);
|
||||
}
|
||||
|
||||
.shell {
|
||||
border-radius: 26px;
|
||||
background: rgba(255,255,255,.78);
|
||||
border: 1px solid rgba(11,11,12,.08);
|
||||
box-shadow: var(--shadow);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.panel {
|
||||
border-radius: var(--radius);
|
||||
background: rgba(255,255,255,.92);
|
||||
border: 1px solid rgba(11,11,12,.06);
|
||||
box-shadow: var(--shadow2);
|
||||
}
|
||||
|
||||
.chip {
|
||||
border-radius: 999px;
|
||||
background: rgba(255,255,255,.8);
|
||||
border: 1px solid rgba(11,11,12,.08);
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 16px;
|
||||
transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
|
||||
}
|
||||
.btn:hover { transform: translateY(-1px); box-shadow: 0 18px 48px rgba(11,11,12,.10); }
|
||||
|
||||
.drawer.hidden { display:none; }
|
||||
/* Custom styles for the application */
|
||||
body {
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018-2024 Jukka Kurkela
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -1,79 +0,0 @@
|
||||
# @kurkle/color
|
||||
|
||||
[](https://www.npmjs.com/package/@kurkle/color) [](https://github.com/kurkle/color/releases/latest) [](https://www.npmjs.com/package/@kurkle/color) [](https://github.com/kurkle/color) [](https://github.com/kurkle/color/blob/main/LICENSE.md)
|
||||
|
||||
## Overview
|
||||
|
||||
Fast and small CSS color parsing and manipulation library.
|
||||
|
||||
## Parsing
|
||||
|
||||
Supported formats:
|
||||
|
||||
- named
|
||||
|
||||
```text
|
||||
blue
|
||||
transparent
|
||||
```
|
||||
|
||||
- hex
|
||||
|
||||
```text
|
||||
#aaa
|
||||
#bbba
|
||||
#1A2b3c
|
||||
#f1f2f388
|
||||
```
|
||||
|
||||
- rgb(a)
|
||||
|
||||
```text
|
||||
rgb(255, 255, 255)
|
||||
rgb(255, 0, 0, 0.5)
|
||||
rgb(50%, 50%, 50%, 50%)
|
||||
rgb(0 0 100% / 80%)
|
||||
rgba(200, 20, 233, 0.2)
|
||||
rgba(200, 20, 233, 2e-1)
|
||||
```
|
||||
|
||||
- hsl(a)
|
||||
|
||||
```text
|
||||
hsl(240deg, 100%, 50.5%)
|
||||
hsl(0deg 100% 50%)
|
||||
hsla(12, 10%, 50%, .3)
|
||||
hsla(-1.2, 10.2%, 50.9%, 0.4)
|
||||
```
|
||||
|
||||
- hwb
|
||||
|
||||
```text
|
||||
hwb(240, 100%, 50.5%)
|
||||
hwb(244, 100%, 100%, 0.6)
|
||||
```
|
||||
|
||||
- hsv
|
||||
|
||||
```text
|
||||
hsv(240, 100%, 50.5%)
|
||||
hsv(244, 100%, 100%, 0.6)
|
||||
```
|
||||
|
||||
## Docs
|
||||
|
||||
[typedocs](https://kurkle.github.io/color/)
|
||||
|
||||
**note** The docs are for the ESM module. UMD module only exports the [default export](https://kurkle.github.io/color/modules.html#default)
|
||||
|
||||
## Benchmarks
|
||||
|
||||
[benchmarks](https://kurkle.github.io/color/dev/bench/)
|
||||
|
||||
## Size visualization
|
||||
|
||||
[color.min.js](https://kurkle.github.io/color/stats.html)
|
||||
|
||||
## License
|
||||
|
||||
`@kurkle/color` is available under the [MIT license](https://github.com/kurkle/color/blob/main/LICENSE.md).
|
||||
624
staticfiles/@kurkle/color/dist/color.cjs
vendored
624
staticfiles/@kurkle/color/dist/color.cjs
vendored
@ -1,624 +0,0 @@
|
||||
/*!
|
||||
* @kurkle/color v0.3.4
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2024 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["@kurkle/color"] = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
|
||||
function round(v) {
|
||||
return v + 0.5 | 0;
|
||||
}
|
||||
const lim = (v, l, h) => Math.max(Math.min(v, h), l);
|
||||
function p2b(v) {
|
||||
return lim(round(v * 2.55), 0, 255);
|
||||
}
|
||||
function b2p(v) {
|
||||
return lim(round(v / 2.55), 0, 100);
|
||||
}
|
||||
function n2b(v) {
|
||||
return lim(round(v * 255), 0, 255);
|
||||
}
|
||||
function b2n(v) {
|
||||
return lim(round(v / 2.55) / 100, 0, 1);
|
||||
}
|
||||
function n2p(v) {
|
||||
return lim(round(v * 100), 0, 100);
|
||||
}
|
||||
|
||||
const map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};
|
||||
const hex = [...'0123456789ABCDEF'];
|
||||
const h1 = b => hex[b & 0xF];
|
||||
const h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];
|
||||
const eq = b => ((b & 0xF0) >> 4) === (b & 0xF);
|
||||
const isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);
|
||||
function hexParse(str) {
|
||||
var len = str.length;
|
||||
var ret;
|
||||
if (str[0] === '#') {
|
||||
if (len === 4 || len === 5) {
|
||||
ret = {
|
||||
r: 255 & map$1[str[1]] * 17,
|
||||
g: 255 & map$1[str[2]] * 17,
|
||||
b: 255 & map$1[str[3]] * 17,
|
||||
a: len === 5 ? map$1[str[4]] * 17 : 255
|
||||
};
|
||||
} else if (len === 7 || len === 9) {
|
||||
ret = {
|
||||
r: map$1[str[1]] << 4 | map$1[str[2]],
|
||||
g: map$1[str[3]] << 4 | map$1[str[4]],
|
||||
b: map$1[str[5]] << 4 | map$1[str[6]],
|
||||
a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255
|
||||
};
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
const alpha = (a, f) => a < 255 ? f(a) : '';
|
||||
function hexString(v) {
|
||||
var f = isShort(v) ? h1 : h2;
|
||||
return v
|
||||
? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const HUE_RE = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;
|
||||
function hsl2rgbn(h, s, l) {
|
||||
const a = s * Math.min(l, 1 - l);
|
||||
const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
||||
return [f(0), f(8), f(4)];
|
||||
}
|
||||
function hsv2rgbn(h, s, v) {
|
||||
const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
||||
return [f(5), f(3), f(1)];
|
||||
}
|
||||
function hwb2rgbn(h, w, b) {
|
||||
const rgb = hsl2rgbn(h, 1, 0.5);
|
||||
let i;
|
||||
if (w + b > 1) {
|
||||
i = 1 / (w + b);
|
||||
w *= i;
|
||||
b *= i;
|
||||
}
|
||||
for (i = 0; i < 3; i++) {
|
||||
rgb[i] *= 1 - w - b;
|
||||
rgb[i] += w;
|
||||
}
|
||||
return rgb;
|
||||
}
|
||||
function hueValue(r, g, b, d, max) {
|
||||
if (r === max) {
|
||||
return ((g - b) / d) + (g < b ? 6 : 0);
|
||||
}
|
||||
if (g === max) {
|
||||
return (b - r) / d + 2;
|
||||
}
|
||||
return (r - g) / d + 4;
|
||||
}
|
||||
function rgb2hsl(v) {
|
||||
const range = 255;
|
||||
const r = v.r / range;
|
||||
const g = v.g / range;
|
||||
const b = v.b / range;
|
||||
const max = Math.max(r, g, b);
|
||||
const min = Math.min(r, g, b);
|
||||
const l = (max + min) / 2;
|
||||
let h, s, d;
|
||||
if (max !== min) {
|
||||
d = max - min;
|
||||
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
||||
h = hueValue(r, g, b, d, max);
|
||||
h = h * 60 + 0.5;
|
||||
}
|
||||
return [h | 0, s || 0, l];
|
||||
}
|
||||
function calln(f, a, b, c) {
|
||||
return (
|
||||
Array.isArray(a)
|
||||
? f(a[0], a[1], a[2])
|
||||
: f(a, b, c)
|
||||
).map(n2b);
|
||||
}
|
||||
function hsl2rgb(h, s, l) {
|
||||
return calln(hsl2rgbn, h, s, l);
|
||||
}
|
||||
function hwb2rgb(h, w, b) {
|
||||
return calln(hwb2rgbn, h, w, b);
|
||||
}
|
||||
function hsv2rgb(h, s, v) {
|
||||
return calln(hsv2rgbn, h, s, v);
|
||||
}
|
||||
function hue(h) {
|
||||
return (h % 360 + 360) % 360;
|
||||
}
|
||||
function hueParse(str) {
|
||||
const m = HUE_RE.exec(str);
|
||||
let a = 255;
|
||||
let v;
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
if (m[5] !== v) {
|
||||
a = m[6] ? p2b(+m[5]) : n2b(+m[5]);
|
||||
}
|
||||
const h = hue(+m[2]);
|
||||
const p1 = +m[3] / 100;
|
||||
const p2 = +m[4] / 100;
|
||||
if (m[1] === 'hwb') {
|
||||
v = hwb2rgb(h, p1, p2);
|
||||
} else if (m[1] === 'hsv') {
|
||||
v = hsv2rgb(h, p1, p2);
|
||||
} else {
|
||||
v = hsl2rgb(h, p1, p2);
|
||||
}
|
||||
return {
|
||||
r: v[0],
|
||||
g: v[1],
|
||||
b: v[2],
|
||||
a: a
|
||||
};
|
||||
}
|
||||
function rotate(v, deg) {
|
||||
var h = rgb2hsl(v);
|
||||
h[0] = hue(h[0] + deg);
|
||||
h = hsl2rgb(h);
|
||||
v.r = h[0];
|
||||
v.g = h[1];
|
||||
v.b = h[2];
|
||||
}
|
||||
function hslString(v) {
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
const a = rgb2hsl(v);
|
||||
const h = a[0];
|
||||
const s = n2p(a[1]);
|
||||
const l = n2p(a[2]);
|
||||
return v.a < 255
|
||||
? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`
|
||||
: `hsl(${h}, ${s}%, ${l}%)`;
|
||||
}
|
||||
|
||||
const map = {
|
||||
x: 'dark',
|
||||
Z: 'light',
|
||||
Y: 're',
|
||||
X: 'blu',
|
||||
W: 'gr',
|
||||
V: 'medium',
|
||||
U: 'slate',
|
||||
A: 'ee',
|
||||
T: 'ol',
|
||||
S: 'or',
|
||||
B: 'ra',
|
||||
C: 'lateg',
|
||||
D: 'ights',
|
||||
R: 'in',
|
||||
Q: 'turquois',
|
||||
E: 'hi',
|
||||
P: 'ro',
|
||||
O: 'al',
|
||||
N: 'le',
|
||||
M: 'de',
|
||||
L: 'yello',
|
||||
F: 'en',
|
||||
K: 'ch',
|
||||
G: 'arks',
|
||||
H: 'ea',
|
||||
I: 'ightg',
|
||||
J: 'wh'
|
||||
};
|
||||
const names$1 = {
|
||||
OiceXe: 'f0f8ff',
|
||||
antiquewEte: 'faebd7',
|
||||
aqua: 'ffff',
|
||||
aquamarRe: '7fffd4',
|
||||
azuY: 'f0ffff',
|
||||
beige: 'f5f5dc',
|
||||
bisque: 'ffe4c4',
|
||||
black: '0',
|
||||
blanKedOmond: 'ffebcd',
|
||||
Xe: 'ff',
|
||||
XeviTet: '8a2be2',
|
||||
bPwn: 'a52a2a',
|
||||
burlywood: 'deb887',
|
||||
caMtXe: '5f9ea0',
|
||||
KartYuse: '7fff00',
|
||||
KocTate: 'd2691e',
|
||||
cSO: 'ff7f50',
|
||||
cSnflowerXe: '6495ed',
|
||||
cSnsilk: 'fff8dc',
|
||||
crimson: 'dc143c',
|
||||
cyan: 'ffff',
|
||||
xXe: '8b',
|
||||
xcyan: '8b8b',
|
||||
xgTMnPd: 'b8860b',
|
||||
xWay: 'a9a9a9',
|
||||
xgYF: '6400',
|
||||
xgYy: 'a9a9a9',
|
||||
xkhaki: 'bdb76b',
|
||||
xmagFta: '8b008b',
|
||||
xTivegYF: '556b2f',
|
||||
xSange: 'ff8c00',
|
||||
xScEd: '9932cc',
|
||||
xYd: '8b0000',
|
||||
xsOmon: 'e9967a',
|
||||
xsHgYF: '8fbc8f',
|
||||
xUXe: '483d8b',
|
||||
xUWay: '2f4f4f',
|
||||
xUgYy: '2f4f4f',
|
||||
xQe: 'ced1',
|
||||
xviTet: '9400d3',
|
||||
dAppRk: 'ff1493',
|
||||
dApskyXe: 'bfff',
|
||||
dimWay: '696969',
|
||||
dimgYy: '696969',
|
||||
dodgerXe: '1e90ff',
|
||||
fiYbrick: 'b22222',
|
||||
flSOwEte: 'fffaf0',
|
||||
foYstWAn: '228b22',
|
||||
fuKsia: 'ff00ff',
|
||||
gaRsbSo: 'dcdcdc',
|
||||
ghostwEte: 'f8f8ff',
|
||||
gTd: 'ffd700',
|
||||
gTMnPd: 'daa520',
|
||||
Way: '808080',
|
||||
gYF: '8000',
|
||||
gYFLw: 'adff2f',
|
||||
gYy: '808080',
|
||||
honeyMw: 'f0fff0',
|
||||
hotpRk: 'ff69b4',
|
||||
RdianYd: 'cd5c5c',
|
||||
Rdigo: '4b0082',
|
||||
ivSy: 'fffff0',
|
||||
khaki: 'f0e68c',
|
||||
lavFMr: 'e6e6fa',
|
||||
lavFMrXsh: 'fff0f5',
|
||||
lawngYF: '7cfc00',
|
||||
NmoncEffon: 'fffacd',
|
||||
ZXe: 'add8e6',
|
||||
ZcSO: 'f08080',
|
||||
Zcyan: 'e0ffff',
|
||||
ZgTMnPdLw: 'fafad2',
|
||||
ZWay: 'd3d3d3',
|
||||
ZgYF: '90ee90',
|
||||
ZgYy: 'd3d3d3',
|
||||
ZpRk: 'ffb6c1',
|
||||
ZsOmon: 'ffa07a',
|
||||
ZsHgYF: '20b2aa',
|
||||
ZskyXe: '87cefa',
|
||||
ZUWay: '778899',
|
||||
ZUgYy: '778899',
|
||||
ZstAlXe: 'b0c4de',
|
||||
ZLw: 'ffffe0',
|
||||
lime: 'ff00',
|
||||
limegYF: '32cd32',
|
||||
lRF: 'faf0e6',
|
||||
magFta: 'ff00ff',
|
||||
maPon: '800000',
|
||||
VaquamarRe: '66cdaa',
|
||||
VXe: 'cd',
|
||||
VScEd: 'ba55d3',
|
||||
VpurpN: '9370db',
|
||||
VsHgYF: '3cb371',
|
||||
VUXe: '7b68ee',
|
||||
VsprRggYF: 'fa9a',
|
||||
VQe: '48d1cc',
|
||||
VviTetYd: 'c71585',
|
||||
midnightXe: '191970',
|
||||
mRtcYam: 'f5fffa',
|
||||
mistyPse: 'ffe4e1',
|
||||
moccasR: 'ffe4b5',
|
||||
navajowEte: 'ffdead',
|
||||
navy: '80',
|
||||
Tdlace: 'fdf5e6',
|
||||
Tive: '808000',
|
||||
TivedBb: '6b8e23',
|
||||
Sange: 'ffa500',
|
||||
SangeYd: 'ff4500',
|
||||
ScEd: 'da70d6',
|
||||
pOegTMnPd: 'eee8aa',
|
||||
pOegYF: '98fb98',
|
||||
pOeQe: 'afeeee',
|
||||
pOeviTetYd: 'db7093',
|
||||
papayawEp: 'ffefd5',
|
||||
pHKpuff: 'ffdab9',
|
||||
peru: 'cd853f',
|
||||
pRk: 'ffc0cb',
|
||||
plum: 'dda0dd',
|
||||
powMrXe: 'b0e0e6',
|
||||
purpN: '800080',
|
||||
YbeccapurpN: '663399',
|
||||
Yd: 'ff0000',
|
||||
Psybrown: 'bc8f8f',
|
||||
PyOXe: '4169e1',
|
||||
saddNbPwn: '8b4513',
|
||||
sOmon: 'fa8072',
|
||||
sandybPwn: 'f4a460',
|
||||
sHgYF: '2e8b57',
|
||||
sHshell: 'fff5ee',
|
||||
siFna: 'a0522d',
|
||||
silver: 'c0c0c0',
|
||||
skyXe: '87ceeb',
|
||||
UXe: '6a5acd',
|
||||
UWay: '708090',
|
||||
UgYy: '708090',
|
||||
snow: 'fffafa',
|
||||
sprRggYF: 'ff7f',
|
||||
stAlXe: '4682b4',
|
||||
tan: 'd2b48c',
|
||||
teO: '8080',
|
||||
tEstN: 'd8bfd8',
|
||||
tomato: 'ff6347',
|
||||
Qe: '40e0d0',
|
||||
viTet: 'ee82ee',
|
||||
JHt: 'f5deb3',
|
||||
wEte: 'ffffff',
|
||||
wEtesmoke: 'f5f5f5',
|
||||
Lw: 'ffff00',
|
||||
LwgYF: '9acd32'
|
||||
};
|
||||
function unpack() {
|
||||
const unpacked = {};
|
||||
const keys = Object.keys(names$1);
|
||||
const tkeys = Object.keys(map);
|
||||
let i, j, k, ok, nk;
|
||||
for (i = 0; i < keys.length; i++) {
|
||||
ok = nk = keys[i];
|
||||
for (j = 0; j < tkeys.length; j++) {
|
||||
k = tkeys[j];
|
||||
nk = nk.replace(k, map[k]);
|
||||
}
|
||||
k = parseInt(names$1[ok], 16);
|
||||
unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];
|
||||
}
|
||||
return unpacked;
|
||||
}
|
||||
|
||||
let names;
|
||||
function nameParse(str) {
|
||||
if (!names) {
|
||||
names = unpack();
|
||||
names.transparent = [0, 0, 0, 0];
|
||||
}
|
||||
const a = names[str.toLowerCase()];
|
||||
return a && {
|
||||
r: a[0],
|
||||
g: a[1],
|
||||
b: a[2],
|
||||
a: a.length === 4 ? a[3] : 255
|
||||
};
|
||||
}
|
||||
|
||||
const RGB_RE = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;
|
||||
function rgbParse(str) {
|
||||
const m = RGB_RE.exec(str);
|
||||
let a = 255;
|
||||
let r, g, b;
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
if (m[7] !== r) {
|
||||
const v = +m[7];
|
||||
a = m[8] ? p2b(v) : lim(v * 255, 0, 255);
|
||||
}
|
||||
r = +m[1];
|
||||
g = +m[3];
|
||||
b = +m[5];
|
||||
r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));
|
||||
g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));
|
||||
b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));
|
||||
return {
|
||||
r: r,
|
||||
g: g,
|
||||
b: b,
|
||||
a: a
|
||||
};
|
||||
}
|
||||
function rgbString(v) {
|
||||
return v && (
|
||||
v.a < 255
|
||||
? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`
|
||||
: `rgb(${v.r}, ${v.g}, ${v.b})`
|
||||
);
|
||||
}
|
||||
|
||||
const to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;
|
||||
const from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
||||
function interpolate(rgb1, rgb2, t) {
|
||||
const r = from(b2n(rgb1.r));
|
||||
const g = from(b2n(rgb1.g));
|
||||
const b = from(b2n(rgb1.b));
|
||||
return {
|
||||
r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),
|
||||
g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),
|
||||
b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),
|
||||
a: rgb1.a + t * (rgb2.a - rgb1.a)
|
||||
};
|
||||
}
|
||||
|
||||
function modHSL(v, i, ratio) {
|
||||
if (v) {
|
||||
let tmp = rgb2hsl(v);
|
||||
tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));
|
||||
tmp = hsl2rgb(tmp);
|
||||
v.r = tmp[0];
|
||||
v.g = tmp[1];
|
||||
v.b = tmp[2];
|
||||
}
|
||||
}
|
||||
function clone(v, proto) {
|
||||
return v ? Object.assign(proto || {}, v) : v;
|
||||
}
|
||||
function fromObject(input) {
|
||||
var v = {r: 0, g: 0, b: 0, a: 255};
|
||||
if (Array.isArray(input)) {
|
||||
if (input.length >= 3) {
|
||||
v = {r: input[0], g: input[1], b: input[2], a: 255};
|
||||
if (input.length > 3) {
|
||||
v.a = n2b(input[3]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v = clone(input, {r: 0, g: 0, b: 0, a: 1});
|
||||
v.a = n2b(v.a);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
function functionParse(str) {
|
||||
if (str.charAt(0) === 'r') {
|
||||
return rgbParse(str);
|
||||
}
|
||||
return hueParse(str);
|
||||
}
|
||||
class Color {
|
||||
constructor(input) {
|
||||
if (input instanceof Color) {
|
||||
return input;
|
||||
}
|
||||
const type = typeof input;
|
||||
let v;
|
||||
if (type === 'object') {
|
||||
v = fromObject(input);
|
||||
} else if (type === 'string') {
|
||||
v = hexParse(input) || nameParse(input) || functionParse(input);
|
||||
}
|
||||
this._rgb = v;
|
||||
this._valid = !!v;
|
||||
}
|
||||
get valid() {
|
||||
return this._valid;
|
||||
}
|
||||
get rgb() {
|
||||
var v = clone(this._rgb);
|
||||
if (v) {
|
||||
v.a = b2n(v.a);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
set rgb(obj) {
|
||||
this._rgb = fromObject(obj);
|
||||
}
|
||||
rgbString() {
|
||||
return this._valid ? rgbString(this._rgb) : undefined;
|
||||
}
|
||||
hexString() {
|
||||
return this._valid ? hexString(this._rgb) : undefined;
|
||||
}
|
||||
hslString() {
|
||||
return this._valid ? hslString(this._rgb) : undefined;
|
||||
}
|
||||
mix(color, weight) {
|
||||
if (color) {
|
||||
const c1 = this.rgb;
|
||||
const c2 = color.rgb;
|
||||
let w2;
|
||||
const p = weight === w2 ? 0.5 : weight;
|
||||
const w = 2 * p - 1;
|
||||
const a = c1.a - c2.a;
|
||||
const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
|
||||
w2 = 1 - w1;
|
||||
c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;
|
||||
c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;
|
||||
c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;
|
||||
c1.a = p * c1.a + (1 - p) * c2.a;
|
||||
this.rgb = c1;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
interpolate(color, t) {
|
||||
if (color) {
|
||||
this._rgb = interpolate(this._rgb, color._rgb, t);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
clone() {
|
||||
return new Color(this.rgb);
|
||||
}
|
||||
alpha(a) {
|
||||
this._rgb.a = n2b(a);
|
||||
return this;
|
||||
}
|
||||
clearer(ratio) {
|
||||
const rgb = this._rgb;
|
||||
rgb.a *= 1 - ratio;
|
||||
return this;
|
||||
}
|
||||
greyscale() {
|
||||
const rgb = this._rgb;
|
||||
const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);
|
||||
rgb.r = rgb.g = rgb.b = val;
|
||||
return this;
|
||||
}
|
||||
opaquer(ratio) {
|
||||
const rgb = this._rgb;
|
||||
rgb.a *= 1 + ratio;
|
||||
return this;
|
||||
}
|
||||
negate() {
|
||||
const v = this._rgb;
|
||||
v.r = 255 - v.r;
|
||||
v.g = 255 - v.g;
|
||||
v.b = 255 - v.b;
|
||||
return this;
|
||||
}
|
||||
lighten(ratio) {
|
||||
modHSL(this._rgb, 2, ratio);
|
||||
return this;
|
||||
}
|
||||
darken(ratio) {
|
||||
modHSL(this._rgb, 2, -ratio);
|
||||
return this;
|
||||
}
|
||||
saturate(ratio) {
|
||||
modHSL(this._rgb, 1, ratio);
|
||||
return this;
|
||||
}
|
||||
desaturate(ratio) {
|
||||
modHSL(this._rgb, 1, -ratio);
|
||||
return this;
|
||||
}
|
||||
rotate(deg) {
|
||||
rotate(this._rgb, deg);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
function index_esm(input) {
|
||||
return new Color(input);
|
||||
}
|
||||
|
||||
var color = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
Color: Color,
|
||||
b2n: b2n,
|
||||
b2p: b2p,
|
||||
default: index_esm,
|
||||
hexParse: hexParse,
|
||||
hexString: hexString,
|
||||
hsl2rgb: hsl2rgb,
|
||||
hslString: hslString,
|
||||
hsv2rgb: hsv2rgb,
|
||||
hueParse: hueParse,
|
||||
hwb2rgb: hwb2rgb,
|
||||
lim: lim,
|
||||
n2b: n2b,
|
||||
n2p: n2p,
|
||||
nameParse: nameParse,
|
||||
p2b: p2b,
|
||||
rgb2hsl: rgb2hsl,
|
||||
rgbParse: rgbParse,
|
||||
rgbString: rgbString,
|
||||
rotate: rotate,
|
||||
round: round
|
||||
});
|
||||
|
||||
var index = Object.assign(index_esm, color);
|
||||
|
||||
return index;
|
||||
|
||||
}));
|
||||
235
staticfiles/@kurkle/color/dist/color.d.ts
vendored
235
staticfiles/@kurkle/color/dist/color.d.ts
vendored
@ -1,235 +0,0 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module @kurkle/color
|
||||
*/
|
||||
export type RGBA = {
|
||||
/**
|
||||
* - red [0..255]
|
||||
*/
|
||||
r: number;
|
||||
/**
|
||||
* - green [0..255]
|
||||
*/
|
||||
g: number;
|
||||
/**
|
||||
* - blue [0..255]
|
||||
*/
|
||||
b: number;
|
||||
/**
|
||||
* - alpha [0..1]
|
||||
*/
|
||||
a: number;
|
||||
};
|
||||
/**
|
||||
* Parse HEX to color
|
||||
* @param {string} str - the string
|
||||
*/
|
||||
export function hexParse(str: string): {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
a: number;
|
||||
};
|
||||
/**
|
||||
* Return HEX string from color
|
||||
* @param {RGBA} v - the color
|
||||
*/
|
||||
export function hexString(v: RGBA): string | RGBA;
|
||||
/**
|
||||
* Rounds decimal to nearest integer
|
||||
* @param {number} v - the number to round
|
||||
*/
|
||||
export function round(v: number): number;
|
||||
/**
|
||||
* convert percent to byte 0..255
|
||||
* @param {number} v - 0..100
|
||||
*/
|
||||
export function p2b(v: number): number;
|
||||
/**
|
||||
* convert byte to percet 0..100
|
||||
* @param {number} v - 0..255
|
||||
*/
|
||||
export function b2p(v: number): number;
|
||||
/**
|
||||
* convert normalized to byte 0..255
|
||||
* @param {number} v - 0..1
|
||||
*/
|
||||
export function n2b(v: number): number;
|
||||
/**
|
||||
* convert byte to normalized 0..1
|
||||
* @param {number} v - 0..255
|
||||
*/
|
||||
export function b2n(v: number): number;
|
||||
/**
|
||||
* convert normalized to percent 0..100
|
||||
* @param {number} v - 0..1
|
||||
*/
|
||||
export function n2p(v: number): number;
|
||||
/**
|
||||
* Convert rgb to hsl
|
||||
* @param {RGBA} v - the color
|
||||
* @returns {number[]} - [h, s, l]
|
||||
*/
|
||||
export function rgb2hsl(v: RGBA): number[];
|
||||
/**
|
||||
* Convert hsl to rgb
|
||||
* @param {number|number[]} h - hue | [h, s, l]
|
||||
* @param {number} [s] - saturation
|
||||
* @param {number} [l] - lightness
|
||||
* @returns {number[]}
|
||||
*/
|
||||
export function hsl2rgb(h: number | number[], s?: number, l?: number): number[];
|
||||
/**
|
||||
* Convert hwb to rgb
|
||||
* @param {number|number[]} h - hue | [h, s, l]
|
||||
* @param {number} [w] - whiteness
|
||||
* @param {number} [b] - blackness
|
||||
* @returns {number[]}
|
||||
*/
|
||||
export function hwb2rgb(h: number | number[], w?: number, b?: number): number[];
|
||||
/**
|
||||
* Convert hsv to rgb
|
||||
* @param {number|number[]} h - hue | [h, s, l]
|
||||
* @param {number} [s] - saturation
|
||||
* @param {number} [v] - value
|
||||
* @returns {number[]}
|
||||
*/
|
||||
export function hsv2rgb(h: number | number[], s?: number, v?: number): number[];
|
||||
/**
|
||||
* Parse hsl/hsv/hwb color string
|
||||
* @param {string} str - hsl/hsv/hwb color string
|
||||
* @returns {RGBA} - the parsed color components
|
||||
*/
|
||||
export function hueParse(str: string): RGBA;
|
||||
/**
|
||||
* Rotate the `v` color by `deg` degrees
|
||||
* @param {RGBA} v - the color
|
||||
* @param {number} deg - degrees to rotate
|
||||
*/
|
||||
export function rotate(v: RGBA, deg: number): void;
|
||||
/**
|
||||
* Return hsl(a) string from color components
|
||||
* @param {RGBA} v - the color
|
||||
* @return {string|undefined}
|
||||
*/
|
||||
export function hslString(v: RGBA): string;
|
||||
/**
|
||||
* Parse color name
|
||||
* @param {string} str - the color name
|
||||
* @return {RGBA} - the color
|
||||
*/
|
||||
export function nameParse(str: string): RGBA;
|
||||
/**
|
||||
* Parse rgb(a) string to RGBA
|
||||
* @param {string} str - the rgb string
|
||||
* @returns {RGBA} - the parsed color
|
||||
*/
|
||||
export function rgbParse(str: string): RGBA;
|
||||
/**
|
||||
* Return rgb(a) string from color
|
||||
* @param {RGBA} v - the color
|
||||
*/
|
||||
export function rgbString(v: RGBA): string;
|
||||
|
||||
export class Color {
|
||||
/**
|
||||
* constructor
|
||||
* @param {Color|RGBA|string|number[]} input
|
||||
*/
|
||||
constructor(input: string | number[] | Color | RGBA);
|
||||
/**
|
||||
* @type {RGBA}
|
||||
* @hidden
|
||||
**/
|
||||
_rgb: RGBA;
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @hidden
|
||||
**/
|
||||
_valid: boolean;
|
||||
/**
|
||||
* `true` if this is a valid color
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get valid(): boolean;
|
||||
/**
|
||||
* @param {RGBA} obj - the color
|
||||
*/
|
||||
set rgb(arg: RGBA);
|
||||
/**
|
||||
* @returns {RGBA} - the color
|
||||
*/
|
||||
get rgb(): RGBA;
|
||||
/**
|
||||
* rgb(a) string
|
||||
*/
|
||||
rgbString(): string;
|
||||
/**
|
||||
* hex string
|
||||
*/
|
||||
hexString(): string;
|
||||
/**
|
||||
* hsl(a) string
|
||||
*/
|
||||
hslString(): string;
|
||||
/**
|
||||
* Mix another color to this color.
|
||||
* @param {Color} color - Color to mix in
|
||||
* @param {number} weight - 0..1
|
||||
*/
|
||||
mix(color: Color, weight: number): Color;
|
||||
/**
|
||||
* Clone
|
||||
*/
|
||||
clone(): Color;
|
||||
/**
|
||||
* Set aplha
|
||||
* @param {number} a - the alpha [0..1]
|
||||
*/
|
||||
alpha(a: number): Color;
|
||||
/**
|
||||
* Make clearer
|
||||
* @param {number} ratio - ratio [0..1]
|
||||
*/
|
||||
clearer(ratio: number): Color;
|
||||
/**
|
||||
* Convert to grayscale
|
||||
*/
|
||||
greyscale(): Color;
|
||||
/**
|
||||
* Opaquer
|
||||
* @param {number} ratio - ratio [0..1]
|
||||
*/
|
||||
opaquer(ratio: number): Color;
|
||||
negate(): Color;
|
||||
/**
|
||||
* Lighten
|
||||
* @param {number} ratio - ratio [0..1]
|
||||
*/
|
||||
lighten(ratio: number): Color;
|
||||
/**
|
||||
* Darken
|
||||
* @param {number} ratio - ratio [0..1]
|
||||
*/
|
||||
darken(ratio: number): Color;
|
||||
/**
|
||||
* Saturate
|
||||
* @param {number} ratio - ratio [0..1]
|
||||
*/
|
||||
saturate(ratio: number): Color;
|
||||
/**
|
||||
* Desaturate
|
||||
* @param {number} ratio - ratio [0..1]
|
||||
*/
|
||||
desaturate(ratio: number): Color;
|
||||
/**
|
||||
* Rotate
|
||||
* @param {number} deg - degrees to rotate
|
||||
*/
|
||||
rotate(deg: number): Color;
|
||||
}
|
||||
/**
|
||||
* Construct new Color instance
|
||||
* @param {Color|RGBA|string|number[]} input
|
||||
*/
|
||||
export default function _default(input: string | number[] | Color | RGBA): Color;
|
||||
589
staticfiles/@kurkle/color/dist/color.esm.js
vendored
589
staticfiles/@kurkle/color/dist/color.esm.js
vendored
@ -1,589 +0,0 @@
|
||||
/*!
|
||||
* @kurkle/color v0.3.4
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2024 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/
|
||||
function round(v) {
|
||||
return v + 0.5 | 0;
|
||||
}
|
||||
const lim = (v, l, h) => Math.max(Math.min(v, h), l);
|
||||
function p2b(v) {
|
||||
return lim(round(v * 2.55), 0, 255);
|
||||
}
|
||||
function b2p(v) {
|
||||
return lim(round(v / 2.55), 0, 100);
|
||||
}
|
||||
function n2b(v) {
|
||||
return lim(round(v * 255), 0, 255);
|
||||
}
|
||||
function b2n(v) {
|
||||
return lim(round(v / 2.55) / 100, 0, 1);
|
||||
}
|
||||
function n2p(v) {
|
||||
return lim(round(v * 100), 0, 100);
|
||||
}
|
||||
|
||||
const map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};
|
||||
const hex = [...'0123456789ABCDEF'];
|
||||
const h1 = b => hex[b & 0xF];
|
||||
const h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];
|
||||
const eq = b => ((b & 0xF0) >> 4) === (b & 0xF);
|
||||
const isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);
|
||||
function hexParse(str) {
|
||||
var len = str.length;
|
||||
var ret;
|
||||
if (str[0] === '#') {
|
||||
if (len === 4 || len === 5) {
|
||||
ret = {
|
||||
r: 255 & map$1[str[1]] * 17,
|
||||
g: 255 & map$1[str[2]] * 17,
|
||||
b: 255 & map$1[str[3]] * 17,
|
||||
a: len === 5 ? map$1[str[4]] * 17 : 255
|
||||
};
|
||||
} else if (len === 7 || len === 9) {
|
||||
ret = {
|
||||
r: map$1[str[1]] << 4 | map$1[str[2]],
|
||||
g: map$1[str[3]] << 4 | map$1[str[4]],
|
||||
b: map$1[str[5]] << 4 | map$1[str[6]],
|
||||
a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255
|
||||
};
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
const alpha = (a, f) => a < 255 ? f(a) : '';
|
||||
function hexString(v) {
|
||||
var f = isShort(v) ? h1 : h2;
|
||||
return v
|
||||
? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const HUE_RE = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;
|
||||
function hsl2rgbn(h, s, l) {
|
||||
const a = s * Math.min(l, 1 - l);
|
||||
const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
||||
return [f(0), f(8), f(4)];
|
||||
}
|
||||
function hsv2rgbn(h, s, v) {
|
||||
const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
||||
return [f(5), f(3), f(1)];
|
||||
}
|
||||
function hwb2rgbn(h, w, b) {
|
||||
const rgb = hsl2rgbn(h, 1, 0.5);
|
||||
let i;
|
||||
if (w + b > 1) {
|
||||
i = 1 / (w + b);
|
||||
w *= i;
|
||||
b *= i;
|
||||
}
|
||||
for (i = 0; i < 3; i++) {
|
||||
rgb[i] *= 1 - w - b;
|
||||
rgb[i] += w;
|
||||
}
|
||||
return rgb;
|
||||
}
|
||||
function hueValue(r, g, b, d, max) {
|
||||
if (r === max) {
|
||||
return ((g - b) / d) + (g < b ? 6 : 0);
|
||||
}
|
||||
if (g === max) {
|
||||
return (b - r) / d + 2;
|
||||
}
|
||||
return (r - g) / d + 4;
|
||||
}
|
||||
function rgb2hsl(v) {
|
||||
const range = 255;
|
||||
const r = v.r / range;
|
||||
const g = v.g / range;
|
||||
const b = v.b / range;
|
||||
const max = Math.max(r, g, b);
|
||||
const min = Math.min(r, g, b);
|
||||
const l = (max + min) / 2;
|
||||
let h, s, d;
|
||||
if (max !== min) {
|
||||
d = max - min;
|
||||
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
||||
h = hueValue(r, g, b, d, max);
|
||||
h = h * 60 + 0.5;
|
||||
}
|
||||
return [h | 0, s || 0, l];
|
||||
}
|
||||
function calln(f, a, b, c) {
|
||||
return (
|
||||
Array.isArray(a)
|
||||
? f(a[0], a[1], a[2])
|
||||
: f(a, b, c)
|
||||
).map(n2b);
|
||||
}
|
||||
function hsl2rgb(h, s, l) {
|
||||
return calln(hsl2rgbn, h, s, l);
|
||||
}
|
||||
function hwb2rgb(h, w, b) {
|
||||
return calln(hwb2rgbn, h, w, b);
|
||||
}
|
||||
function hsv2rgb(h, s, v) {
|
||||
return calln(hsv2rgbn, h, s, v);
|
||||
}
|
||||
function hue(h) {
|
||||
return (h % 360 + 360) % 360;
|
||||
}
|
||||
function hueParse(str) {
|
||||
const m = HUE_RE.exec(str);
|
||||
let a = 255;
|
||||
let v;
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
if (m[5] !== v) {
|
||||
a = m[6] ? p2b(+m[5]) : n2b(+m[5]);
|
||||
}
|
||||
const h = hue(+m[2]);
|
||||
const p1 = +m[3] / 100;
|
||||
const p2 = +m[4] / 100;
|
||||
if (m[1] === 'hwb') {
|
||||
v = hwb2rgb(h, p1, p2);
|
||||
} else if (m[1] === 'hsv') {
|
||||
v = hsv2rgb(h, p1, p2);
|
||||
} else {
|
||||
v = hsl2rgb(h, p1, p2);
|
||||
}
|
||||
return {
|
||||
r: v[0],
|
||||
g: v[1],
|
||||
b: v[2],
|
||||
a: a
|
||||
};
|
||||
}
|
||||
function rotate(v, deg) {
|
||||
var h = rgb2hsl(v);
|
||||
h[0] = hue(h[0] + deg);
|
||||
h = hsl2rgb(h);
|
||||
v.r = h[0];
|
||||
v.g = h[1];
|
||||
v.b = h[2];
|
||||
}
|
||||
function hslString(v) {
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
const a = rgb2hsl(v);
|
||||
const h = a[0];
|
||||
const s = n2p(a[1]);
|
||||
const l = n2p(a[2]);
|
||||
return v.a < 255
|
||||
? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`
|
||||
: `hsl(${h}, ${s}%, ${l}%)`;
|
||||
}
|
||||
|
||||
const map = {
|
||||
x: 'dark',
|
||||
Z: 'light',
|
||||
Y: 're',
|
||||
X: 'blu',
|
||||
W: 'gr',
|
||||
V: 'medium',
|
||||
U: 'slate',
|
||||
A: 'ee',
|
||||
T: 'ol',
|
||||
S: 'or',
|
||||
B: 'ra',
|
||||
C: 'lateg',
|
||||
D: 'ights',
|
||||
R: 'in',
|
||||
Q: 'turquois',
|
||||
E: 'hi',
|
||||
P: 'ro',
|
||||
O: 'al',
|
||||
N: 'le',
|
||||
M: 'de',
|
||||
L: 'yello',
|
||||
F: 'en',
|
||||
K: 'ch',
|
||||
G: 'arks',
|
||||
H: 'ea',
|
||||
I: 'ightg',
|
||||
J: 'wh'
|
||||
};
|
||||
const names$1 = {
|
||||
OiceXe: 'f0f8ff',
|
||||
antiquewEte: 'faebd7',
|
||||
aqua: 'ffff',
|
||||
aquamarRe: '7fffd4',
|
||||
azuY: 'f0ffff',
|
||||
beige: 'f5f5dc',
|
||||
bisque: 'ffe4c4',
|
||||
black: '0',
|
||||
blanKedOmond: 'ffebcd',
|
||||
Xe: 'ff',
|
||||
XeviTet: '8a2be2',
|
||||
bPwn: 'a52a2a',
|
||||
burlywood: 'deb887',
|
||||
caMtXe: '5f9ea0',
|
||||
KartYuse: '7fff00',
|
||||
KocTate: 'd2691e',
|
||||
cSO: 'ff7f50',
|
||||
cSnflowerXe: '6495ed',
|
||||
cSnsilk: 'fff8dc',
|
||||
crimson: 'dc143c',
|
||||
cyan: 'ffff',
|
||||
xXe: '8b',
|
||||
xcyan: '8b8b',
|
||||
xgTMnPd: 'b8860b',
|
||||
xWay: 'a9a9a9',
|
||||
xgYF: '6400',
|
||||
xgYy: 'a9a9a9',
|
||||
xkhaki: 'bdb76b',
|
||||
xmagFta: '8b008b',
|
||||
xTivegYF: '556b2f',
|
||||
xSange: 'ff8c00',
|
||||
xScEd: '9932cc',
|
||||
xYd: '8b0000',
|
||||
xsOmon: 'e9967a',
|
||||
xsHgYF: '8fbc8f',
|
||||
xUXe: '483d8b',
|
||||
xUWay: '2f4f4f',
|
||||
xUgYy: '2f4f4f',
|
||||
xQe: 'ced1',
|
||||
xviTet: '9400d3',
|
||||
dAppRk: 'ff1493',
|
||||
dApskyXe: 'bfff',
|
||||
dimWay: '696969',
|
||||
dimgYy: '696969',
|
||||
dodgerXe: '1e90ff',
|
||||
fiYbrick: 'b22222',
|
||||
flSOwEte: 'fffaf0',
|
||||
foYstWAn: '228b22',
|
||||
fuKsia: 'ff00ff',
|
||||
gaRsbSo: 'dcdcdc',
|
||||
ghostwEte: 'f8f8ff',
|
||||
gTd: 'ffd700',
|
||||
gTMnPd: 'daa520',
|
||||
Way: '808080',
|
||||
gYF: '8000',
|
||||
gYFLw: 'adff2f',
|
||||
gYy: '808080',
|
||||
honeyMw: 'f0fff0',
|
||||
hotpRk: 'ff69b4',
|
||||
RdianYd: 'cd5c5c',
|
||||
Rdigo: '4b0082',
|
||||
ivSy: 'fffff0',
|
||||
khaki: 'f0e68c',
|
||||
lavFMr: 'e6e6fa',
|
||||
lavFMrXsh: 'fff0f5',
|
||||
lawngYF: '7cfc00',
|
||||
NmoncEffon: 'fffacd',
|
||||
ZXe: 'add8e6',
|
||||
ZcSO: 'f08080',
|
||||
Zcyan: 'e0ffff',
|
||||
ZgTMnPdLw: 'fafad2',
|
||||
ZWay: 'd3d3d3',
|
||||
ZgYF: '90ee90',
|
||||
ZgYy: 'd3d3d3',
|
||||
ZpRk: 'ffb6c1',
|
||||
ZsOmon: 'ffa07a',
|
||||
ZsHgYF: '20b2aa',
|
||||
ZskyXe: '87cefa',
|
||||
ZUWay: '778899',
|
||||
ZUgYy: '778899',
|
||||
ZstAlXe: 'b0c4de',
|
||||
ZLw: 'ffffe0',
|
||||
lime: 'ff00',
|
||||
limegYF: '32cd32',
|
||||
lRF: 'faf0e6',
|
||||
magFta: 'ff00ff',
|
||||
maPon: '800000',
|
||||
VaquamarRe: '66cdaa',
|
||||
VXe: 'cd',
|
||||
VScEd: 'ba55d3',
|
||||
VpurpN: '9370db',
|
||||
VsHgYF: '3cb371',
|
||||
VUXe: '7b68ee',
|
||||
VsprRggYF: 'fa9a',
|
||||
VQe: '48d1cc',
|
||||
VviTetYd: 'c71585',
|
||||
midnightXe: '191970',
|
||||
mRtcYam: 'f5fffa',
|
||||
mistyPse: 'ffe4e1',
|
||||
moccasR: 'ffe4b5',
|
||||
navajowEte: 'ffdead',
|
||||
navy: '80',
|
||||
Tdlace: 'fdf5e6',
|
||||
Tive: '808000',
|
||||
TivedBb: '6b8e23',
|
||||
Sange: 'ffa500',
|
||||
SangeYd: 'ff4500',
|
||||
ScEd: 'da70d6',
|
||||
pOegTMnPd: 'eee8aa',
|
||||
pOegYF: '98fb98',
|
||||
pOeQe: 'afeeee',
|
||||
pOeviTetYd: 'db7093',
|
||||
papayawEp: 'ffefd5',
|
||||
pHKpuff: 'ffdab9',
|
||||
peru: 'cd853f',
|
||||
pRk: 'ffc0cb',
|
||||
plum: 'dda0dd',
|
||||
powMrXe: 'b0e0e6',
|
||||
purpN: '800080',
|
||||
YbeccapurpN: '663399',
|
||||
Yd: 'ff0000',
|
||||
Psybrown: 'bc8f8f',
|
||||
PyOXe: '4169e1',
|
||||
saddNbPwn: '8b4513',
|
||||
sOmon: 'fa8072',
|
||||
sandybPwn: 'f4a460',
|
||||
sHgYF: '2e8b57',
|
||||
sHshell: 'fff5ee',
|
||||
siFna: 'a0522d',
|
||||
silver: 'c0c0c0',
|
||||
skyXe: '87ceeb',
|
||||
UXe: '6a5acd',
|
||||
UWay: '708090',
|
||||
UgYy: '708090',
|
||||
snow: 'fffafa',
|
||||
sprRggYF: 'ff7f',
|
||||
stAlXe: '4682b4',
|
||||
tan: 'd2b48c',
|
||||
teO: '8080',
|
||||
tEstN: 'd8bfd8',
|
||||
tomato: 'ff6347',
|
||||
Qe: '40e0d0',
|
||||
viTet: 'ee82ee',
|
||||
JHt: 'f5deb3',
|
||||
wEte: 'ffffff',
|
||||
wEtesmoke: 'f5f5f5',
|
||||
Lw: 'ffff00',
|
||||
LwgYF: '9acd32'
|
||||
};
|
||||
function unpack() {
|
||||
const unpacked = {};
|
||||
const keys = Object.keys(names$1);
|
||||
const tkeys = Object.keys(map);
|
||||
let i, j, k, ok, nk;
|
||||
for (i = 0; i < keys.length; i++) {
|
||||
ok = nk = keys[i];
|
||||
for (j = 0; j < tkeys.length; j++) {
|
||||
k = tkeys[j];
|
||||
nk = nk.replace(k, map[k]);
|
||||
}
|
||||
k = parseInt(names$1[ok], 16);
|
||||
unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];
|
||||
}
|
||||
return unpacked;
|
||||
}
|
||||
|
||||
let names;
|
||||
function nameParse(str) {
|
||||
if (!names) {
|
||||
names = unpack();
|
||||
names.transparent = [0, 0, 0, 0];
|
||||
}
|
||||
const a = names[str.toLowerCase()];
|
||||
return a && {
|
||||
r: a[0],
|
||||
g: a[1],
|
||||
b: a[2],
|
||||
a: a.length === 4 ? a[3] : 255
|
||||
};
|
||||
}
|
||||
|
||||
const RGB_RE = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;
|
||||
function rgbParse(str) {
|
||||
const m = RGB_RE.exec(str);
|
||||
let a = 255;
|
||||
let r, g, b;
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
if (m[7] !== r) {
|
||||
const v = +m[7];
|
||||
a = m[8] ? p2b(v) : lim(v * 255, 0, 255);
|
||||
}
|
||||
r = +m[1];
|
||||
g = +m[3];
|
||||
b = +m[5];
|
||||
r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));
|
||||
g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));
|
||||
b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));
|
||||
return {
|
||||
r: r,
|
||||
g: g,
|
||||
b: b,
|
||||
a: a
|
||||
};
|
||||
}
|
||||
function rgbString(v) {
|
||||
return v && (
|
||||
v.a < 255
|
||||
? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`
|
||||
: `rgb(${v.r}, ${v.g}, ${v.b})`
|
||||
);
|
||||
}
|
||||
|
||||
const to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;
|
||||
const from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
||||
function interpolate(rgb1, rgb2, t) {
|
||||
const r = from(b2n(rgb1.r));
|
||||
const g = from(b2n(rgb1.g));
|
||||
const b = from(b2n(rgb1.b));
|
||||
return {
|
||||
r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),
|
||||
g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),
|
||||
b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),
|
||||
a: rgb1.a + t * (rgb2.a - rgb1.a)
|
||||
};
|
||||
}
|
||||
|
||||
function modHSL(v, i, ratio) {
|
||||
if (v) {
|
||||
let tmp = rgb2hsl(v);
|
||||
tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));
|
||||
tmp = hsl2rgb(tmp);
|
||||
v.r = tmp[0];
|
||||
v.g = tmp[1];
|
||||
v.b = tmp[2];
|
||||
}
|
||||
}
|
||||
function clone(v, proto) {
|
||||
return v ? Object.assign(proto || {}, v) : v;
|
||||
}
|
||||
function fromObject(input) {
|
||||
var v = {r: 0, g: 0, b: 0, a: 255};
|
||||
if (Array.isArray(input)) {
|
||||
if (input.length >= 3) {
|
||||
v = {r: input[0], g: input[1], b: input[2], a: 255};
|
||||
if (input.length > 3) {
|
||||
v.a = n2b(input[3]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v = clone(input, {r: 0, g: 0, b: 0, a: 1});
|
||||
v.a = n2b(v.a);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
function functionParse(str) {
|
||||
if (str.charAt(0) === 'r') {
|
||||
return rgbParse(str);
|
||||
}
|
||||
return hueParse(str);
|
||||
}
|
||||
class Color {
|
||||
constructor(input) {
|
||||
if (input instanceof Color) {
|
||||
return input;
|
||||
}
|
||||
const type = typeof input;
|
||||
let v;
|
||||
if (type === 'object') {
|
||||
v = fromObject(input);
|
||||
} else if (type === 'string') {
|
||||
v = hexParse(input) || nameParse(input) || functionParse(input);
|
||||
}
|
||||
this._rgb = v;
|
||||
this._valid = !!v;
|
||||
}
|
||||
get valid() {
|
||||
return this._valid;
|
||||
}
|
||||
get rgb() {
|
||||
var v = clone(this._rgb);
|
||||
if (v) {
|
||||
v.a = b2n(v.a);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
set rgb(obj) {
|
||||
this._rgb = fromObject(obj);
|
||||
}
|
||||
rgbString() {
|
||||
return this._valid ? rgbString(this._rgb) : undefined;
|
||||
}
|
||||
hexString() {
|
||||
return this._valid ? hexString(this._rgb) : undefined;
|
||||
}
|
||||
hslString() {
|
||||
return this._valid ? hslString(this._rgb) : undefined;
|
||||
}
|
||||
mix(color, weight) {
|
||||
if (color) {
|
||||
const c1 = this.rgb;
|
||||
const c2 = color.rgb;
|
||||
let w2;
|
||||
const p = weight === w2 ? 0.5 : weight;
|
||||
const w = 2 * p - 1;
|
||||
const a = c1.a - c2.a;
|
||||
const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
|
||||
w2 = 1 - w1;
|
||||
c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;
|
||||
c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;
|
||||
c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;
|
||||
c1.a = p * c1.a + (1 - p) * c2.a;
|
||||
this.rgb = c1;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
interpolate(color, t) {
|
||||
if (color) {
|
||||
this._rgb = interpolate(this._rgb, color._rgb, t);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
clone() {
|
||||
return new Color(this.rgb);
|
||||
}
|
||||
alpha(a) {
|
||||
this._rgb.a = n2b(a);
|
||||
return this;
|
||||
}
|
||||
clearer(ratio) {
|
||||
const rgb = this._rgb;
|
||||
rgb.a *= 1 - ratio;
|
||||
return this;
|
||||
}
|
||||
greyscale() {
|
||||
const rgb = this._rgb;
|
||||
const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);
|
||||
rgb.r = rgb.g = rgb.b = val;
|
||||
return this;
|
||||
}
|
||||
opaquer(ratio) {
|
||||
const rgb = this._rgb;
|
||||
rgb.a *= 1 + ratio;
|
||||
return this;
|
||||
}
|
||||
negate() {
|
||||
const v = this._rgb;
|
||||
v.r = 255 - v.r;
|
||||
v.g = 255 - v.g;
|
||||
v.b = 255 - v.b;
|
||||
return this;
|
||||
}
|
||||
lighten(ratio) {
|
||||
modHSL(this._rgb, 2, ratio);
|
||||
return this;
|
||||
}
|
||||
darken(ratio) {
|
||||
modHSL(this._rgb, 2, -ratio);
|
||||
return this;
|
||||
}
|
||||
saturate(ratio) {
|
||||
modHSL(this._rgb, 1, ratio);
|
||||
return this;
|
||||
}
|
||||
desaturate(ratio) {
|
||||
modHSL(this._rgb, 1, -ratio);
|
||||
return this;
|
||||
}
|
||||
rotate(deg) {
|
||||
rotate(this._rgb, deg);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
function index_esm(input) {
|
||||
return new Color(input);
|
||||
}
|
||||
|
||||
export { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };
|
||||
8
staticfiles/@kurkle/color/dist/color.min.js
vendored
8
staticfiles/@kurkle/color/dist/color.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,77 +0,0 @@
|
||||
{
|
||||
"name": "@kurkle/color",
|
||||
"type": "module",
|
||||
"version": "0.3.4",
|
||||
"description": "css color parsing, manupulation and conversion",
|
||||
"sideEffects": false,
|
||||
"main": "dist/color.cjs",
|
||||
"module": "dist/color.esm.js",
|
||||
"types": "dist/color.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/color.d.ts",
|
||||
"import": "./dist/color.esm.js",
|
||||
"require": "./dist/color.cjs"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node util/copy_dist.js && rollup -c",
|
||||
"lint": "eslint src/*.js test/*.js util/*.js",
|
||||
"test": "node test/index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kurkle/color.git"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"dist/color.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"css",
|
||||
"hsl",
|
||||
"hex",
|
||||
"rgb",
|
||||
"rgba",
|
||||
"hwb",
|
||||
"hsv",
|
||||
"cmyk"
|
||||
],
|
||||
"author": "Jukka Kurkela",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/kurkle/color/issues"
|
||||
},
|
||||
"homepage": "https://github.com/kurkle/color#readme",
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-terser": "^0.4.0",
|
||||
"assert": "^2.0.0",
|
||||
"benchmark": "^2.1.4",
|
||||
"chartjs-color": "^2.4.1",
|
||||
"chartjs-color-string": "^0.6.0",
|
||||
"child_process": "^1.0.2",
|
||||
"chroma-js": "^3.1.1",
|
||||
"color-name": "^2.0.0",
|
||||
"color-names": "^2.0.0",
|
||||
"color-parse": "^2.0.2",
|
||||
"color-parser": "^0.1.0",
|
||||
"color-string": "^1.5.5",
|
||||
"csscolorparser": "^1.0.3",
|
||||
"eslint": "^9.15.0",
|
||||
"eslint-config-chartjs": "^0.3.0",
|
||||
"eslint-config-defaults": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-react": "^7.22.0",
|
||||
"fs": "0.0.1-security",
|
||||
"perf_hooks": "0.0.1",
|
||||
"rollup": "^4.25.0",
|
||||
"rollup-plugin-analyzer": "^4.0.0",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-istanbul": "^5.0.0",
|
||||
"rollup-plugin-visualizer": "^5.8.3",
|
||||
"tinycolor2": "^1.4.2",
|
||||
"typedoc": "^0.26.7",
|
||||
"typescript": "^5.6.2",
|
||||
"util": "^0.12.3"
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2024 Chart.js Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -1,38 +0,0 @@
|
||||
<p align="center">
|
||||
<a href="https://www.chartjs.org/" target="_blank">
|
||||
<img src="https://www.chartjs.org/media/logo-title.svg" alt="https://www.chartjs.org/"><br/>
|
||||
</a>
|
||||
Simple yet flexible JavaScript charting for designers & developers
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.chartjs.org/docs/latest/getting-started/installation.html"><img src="https://img.shields.io/github/release/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Downloads"></a>
|
||||
<a href="https://github.com/chartjs/Chart.js/actions?query=workflow%3ACI+branch%3Amaster"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/chartjs/Chart.js/ci.yml?branch=master&style=flat-square"></a>
|
||||
<a href="https://coveralls.io/github/chartjs/Chart.js?branch=master"><img src="https://img.shields.io/coveralls/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Coverage"></a>
|
||||
<a href="https://github.com/chartjs/awesome"><img src="https://awesome.re/badge-flat2.svg" alt="Awesome"></a>
|
||||
<a href="https://discord.gg/HxEguTK6av"><img src="https://img.shields.io/badge/discord-chartjs-blue?style=flat-square&maxAge=3600" alt="Discord"></a>
|
||||
</p>
|
||||
|
||||
## Documentation
|
||||
|
||||
All the links point to the new version 4 of the lib.
|
||||
|
||||
* [Introduction](https://www.chartjs.org/docs/latest/)
|
||||
* [Getting Started](https://www.chartjs.org/docs/latest/getting-started/index)
|
||||
* [General](https://www.chartjs.org/docs/latest/general/data-structures)
|
||||
* [Configuration](https://www.chartjs.org/docs/latest/configuration/index)
|
||||
* [Charts](https://www.chartjs.org/docs/latest/charts/line)
|
||||
* [Axes](https://www.chartjs.org/docs/latest/axes/index)
|
||||
* [Developers](https://www.chartjs.org/docs/latest/developers/index)
|
||||
* [Popular Extensions](https://github.com/chartjs/awesome)
|
||||
* [Samples](https://www.chartjs.org/samples/)
|
||||
|
||||
In case you are looking for an older version of the docs, you will have to specify the specific version in the url like this: [https://www.chartjs.org/docs/2.9.4/](https://www.chartjs.org/docs/2.9.4/)
|
||||
|
||||
## Contributing
|
||||
|
||||
Instructions on building and testing Chart.js can be found in [the documentation](https://www.chartjs.org/docs/master/developers/contributing.html#building-and-testing). Before submitting an issue or a pull request, please take a moment to look over the [contributing guidelines](https://www.chartjs.org/docs/master/developers/contributing) first. For support, please post questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/chart.js) with the `chart.js` tag.
|
||||
|
||||
## License
|
||||
|
||||
Chart.js is available under the [MIT license](LICENSE.md).
|
||||
@ -1,6 +0,0 @@
|
||||
const chartjs = require('../dist/chart.cjs');
|
||||
const {Chart, registerables} = chartjs;
|
||||
|
||||
Chart.register(...registerables);
|
||||
|
||||
module.exports = Object.assign(Chart, chartjs);
|
||||
4
staticfiles/chart.js/auto/auto.d.ts
vendored
4
staticfiles/chart.js/auto/auto.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
import {Chart} from '../dist/types.js';
|
||||
|
||||
export * from '../dist/types.js';
|
||||
export default Chart;
|
||||
@ -1,6 +0,0 @@
|
||||
import {Chart, registerables} from '../dist/chart.js';
|
||||
|
||||
Chart.register(...registerables);
|
||||
|
||||
export * from '../dist/chart.js';
|
||||
export default Chart;
|
||||
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "chart.js-auto",
|
||||
"private": true,
|
||||
"description": "Auto registering package. Exists to support bundlers without exports support such as webpack 4.",
|
||||
"type": "module",
|
||||
"main": "./auto.cjs",
|
||||
"module": "./auto.js",
|
||||
"exports": {
|
||||
"types": "./auto.d.ts",
|
||||
"import": "./auto.js",
|
||||
"require": "./auto.cjs"
|
||||
},
|
||||
"types": "./auto.d.ts"
|
||||
}
|
||||
11647
staticfiles/chart.js/dist/chart.cjs
vendored
11647
staticfiles/chart.js/dist/chart.cjs
vendored
File diff suppressed because it is too large
Load Diff
1
staticfiles/chart.js/dist/chart.cjs.map
vendored
1
staticfiles/chart.js/dist/chart.cjs.map
vendored
File diff suppressed because one or more lines are too long
11599
staticfiles/chart.js/dist/chart.js
vendored
11599
staticfiles/chart.js/dist/chart.js
vendored
File diff suppressed because it is too large
Load Diff
1
staticfiles/chart.js/dist/chart.js.map
vendored
1
staticfiles/chart.js/dist/chart.js.map
vendored
File diff suppressed because one or more lines are too long
14
staticfiles/chart.js/dist/chart.umd.js
vendored
14
staticfiles/chart.js/dist/chart.umd.js
vendored
File diff suppressed because one or more lines are too long
1
staticfiles/chart.js/dist/chart.umd.js.map
vendored
1
staticfiles/chart.js/dist/chart.umd.js.map
vendored
File diff suppressed because one or more lines are too long
14
staticfiles/chart.js/dist/chart.umd.min.js
vendored
14
staticfiles/chart.js/dist/chart.umd.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2915
staticfiles/chart.js/dist/chunks/helpers.dataset.cjs
vendored
2915
staticfiles/chart.js/dist/chunks/helpers.dataset.cjs
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
2788
staticfiles/chart.js/dist/chunks/helpers.dataset.js
vendored
2788
staticfiles/chart.js/dist/chunks/helpers.dataset.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,65 +0,0 @@
|
||||
export default class BarController extends DatasetController {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static overrides: any;
|
||||
/**
|
||||
* Overriding primitive data parsing since we support mixed primitive/array
|
||||
* data for float bars
|
||||
* @protected
|
||||
*/
|
||||
protected parsePrimitiveData(meta: any, data: any, start: any, count: any): any[];
|
||||
/**
|
||||
* Overriding array data parsing since we support mixed primitive/array
|
||||
* data for float bars
|
||||
* @protected
|
||||
*/
|
||||
protected parseArrayData(meta: any, data: any, start: any, count: any): any[];
|
||||
/**
|
||||
* Overriding object data parsing since we support mixed primitive/array
|
||||
* value-scale data for float bars
|
||||
* @protected
|
||||
*/
|
||||
protected parseObjectData(meta: any, data: any, start: any, count: any): any[];
|
||||
update(mode: any): void;
|
||||
/**
|
||||
* Returns the stacks based on groups and bar visibility.
|
||||
* @param {number} [last] - The dataset index
|
||||
* @param {number} [dataIndex] - The data index of the ruler
|
||||
* @returns {string[]} The list of stack IDs
|
||||
* @private
|
||||
*/
|
||||
private _getStacks;
|
||||
/**
|
||||
* Returns the effective number of stacks based on groups and bar visibility.
|
||||
* @private
|
||||
*/
|
||||
private _getStackCount;
|
||||
_getAxisCount(): number;
|
||||
getFirstScaleIdForIndexAxis(): string;
|
||||
_getAxis(): string[];
|
||||
/**
|
||||
* Returns the stack index for the given dataset based on groups and bar visibility.
|
||||
* @param {number} [datasetIndex] - The dataset index
|
||||
* @param {string} [name] - The stack name to find
|
||||
* @param {number} [dataIndex]
|
||||
* @returns {number} The stack index
|
||||
* @private
|
||||
*/
|
||||
private _getStackIndex;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getRuler;
|
||||
/**
|
||||
* Note: pixel values are not clamped to the scale area.
|
||||
* @private
|
||||
*/
|
||||
private _calculateBarValuePixels;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _calculateBarIndexPixels;
|
||||
}
|
||||
import DatasetController from "../core/core.datasetController.js";
|
||||
@ -1,35 +0,0 @@
|
||||
export default class BubbleController extends DatasetController {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static overrides: any;
|
||||
/**
|
||||
* Parse array of primitive values
|
||||
* @protected
|
||||
*/
|
||||
protected parsePrimitiveData(meta: any, data: any, start: any, count: any): any;
|
||||
/**
|
||||
* Parse array of arrays
|
||||
* @protected
|
||||
*/
|
||||
protected parseArrayData(meta: any, data: any, start: any, count: any): any;
|
||||
/**
|
||||
* Parse array of objects
|
||||
* @protected
|
||||
*/
|
||||
protected parseObjectData(meta: any, data: any, start: any, count: any): any;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getMaxOverflow(): number;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getLabelAndValue(index: any): {
|
||||
label: any;
|
||||
value: string;
|
||||
};
|
||||
update(mode: any): void;
|
||||
}
|
||||
import DatasetController from "../core/core.datasetController.js";
|
||||
@ -1,64 +0,0 @@
|
||||
export default class DoughnutController extends DatasetController {
|
||||
static id: string;
|
||||
static descriptors: {
|
||||
_scriptable: (name: any) => boolean;
|
||||
_indexable: (name: any) => boolean;
|
||||
};
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static overrides: any;
|
||||
constructor(chart: any, datasetIndex: any);
|
||||
innerRadius: number;
|
||||
outerRadius: number;
|
||||
offsetX: number;
|
||||
offsetY: number;
|
||||
/**
|
||||
* Override data parsing, since we are not using scales
|
||||
*/
|
||||
parse(start: any, count: any): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getRotation;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getCircumference;
|
||||
/**
|
||||
* Get the maximal rotation & circumference extents
|
||||
* across all visible datasets.
|
||||
*/
|
||||
_getRotationExtents(): {
|
||||
rotation: number;
|
||||
circumference: number;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _circumference;
|
||||
calculateTotal(): number;
|
||||
calculateCircumference(value: any): number;
|
||||
getLabelAndValue(index: any): {
|
||||
label: any;
|
||||
value: string;
|
||||
};
|
||||
getMaxBorderWidth(arcs: any): number;
|
||||
getMaxOffset(arcs: any): number;
|
||||
/**
|
||||
* Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly
|
||||
* @private
|
||||
*/
|
||||
private _getRingWeightOffset;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getRingWeight;
|
||||
/**
|
||||
* Returns the sum of all visible data set weights.
|
||||
* @private
|
||||
*/
|
||||
private _getVisibleDatasetWeightTotal;
|
||||
}
|
||||
export type Chart = import('../core/core.controller.js').default;
|
||||
import DatasetController from "../core/core.datasetController.js";
|
||||
@ -1,13 +0,0 @@
|
||||
export default class LineController extends DatasetController {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static overrides: any;
|
||||
update(mode: any): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getMaxOverflow(): any;
|
||||
}
|
||||
import DatasetController from "../core/core.datasetController.js";
|
||||
@ -1,3 +0,0 @@
|
||||
export default class PieController extends DoughnutController {
|
||||
}
|
||||
import DoughnutController from "./controller.doughnut.js";
|
||||
@ -1,35 +0,0 @@
|
||||
export default class PolarAreaController extends DatasetController {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static overrides: any;
|
||||
constructor(chart: any, datasetIndex: any);
|
||||
innerRadius: number;
|
||||
outerRadius: number;
|
||||
getLabelAndValue(index: any): {
|
||||
label: any;
|
||||
value: string;
|
||||
};
|
||||
parseObjectData(meta: any, data: any, start: any, count: any): {
|
||||
r: unknown;
|
||||
}[];
|
||||
update(mode: any): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getMinMax(): {
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _updateRadius;
|
||||
countVisibleElements(): number;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _computeAngle;
|
||||
}
|
||||
import DatasetController from "../core/core.datasetController.js";
|
||||
@ -1,19 +0,0 @@
|
||||
export default class RadarController extends DatasetController {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static overrides: any;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getLabelAndValue(index: any): {
|
||||
label: any;
|
||||
value: string;
|
||||
};
|
||||
parseObjectData(meta: any, data: any, start: any, count: any): {
|
||||
r: unknown;
|
||||
}[];
|
||||
update(mode: any): void;
|
||||
}
|
||||
import DatasetController from "../core/core.datasetController.js";
|
||||
@ -1,20 +0,0 @@
|
||||
export default class ScatterController extends DatasetController {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static overrides: any;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getLabelAndValue(index: any): {
|
||||
label: any;
|
||||
value: string;
|
||||
};
|
||||
update(mode: any): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getMaxOverflow(): any;
|
||||
}
|
||||
import DatasetController from "../core/core.datasetController.js";
|
||||
@ -1,8 +0,0 @@
|
||||
export { default as BarController } from "./controller.bar.js";
|
||||
export { default as BubbleController } from "./controller.bubble.js";
|
||||
export { default as DoughnutController } from "./controller.doughnut.js";
|
||||
export { default as LineController } from "./controller.line.js";
|
||||
export { default as PolarAreaController } from "./controller.polarArea.js";
|
||||
export { default as PieController } from "./controller.pie.js";
|
||||
export { default as RadarController } from "./controller.radar.js";
|
||||
export { default as ScatterController } from "./controller.scatter.js";
|
||||
@ -1,67 +0,0 @@
|
||||
/**
|
||||
* @namespace Chart._adapters
|
||||
* @since 2.8.0
|
||||
* @private
|
||||
*/
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { ChartOptions } from '../types/index.js';
|
||||
export type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
||||
export interface DateAdapter<T extends AnyObject = AnyObject> {
|
||||
readonly options: T;
|
||||
/**
|
||||
* Will called with chart options after adapter creation.
|
||||
*/
|
||||
init(this: DateAdapter<T>, chartOptions: ChartOptions): void;
|
||||
/**
|
||||
* Returns a map of time formats for the supported formatting units defined
|
||||
* in Unit as well as 'datetime' representing a detailed date/time string.
|
||||
*/
|
||||
formats(this: DateAdapter<T>): Record<TimeUnit | 'datetime', string>;
|
||||
/**
|
||||
* Parses the given `value` and return the associated timestamp.
|
||||
* @param value - the value to parse (usually comes from the data)
|
||||
* @param [format] - the expected data format
|
||||
*/
|
||||
parse(this: DateAdapter<T>, value: unknown, format?: string): number | null;
|
||||
/**
|
||||
* Returns the formatted date in the specified `format` for a given `timestamp`.
|
||||
* @param timestamp - the timestamp to format
|
||||
* @param format - the date/time token
|
||||
*/
|
||||
format(this: DateAdapter<T>, timestamp: number, format: string): string;
|
||||
/**
|
||||
* Adds the specified `amount` of `unit` to the given `timestamp`.
|
||||
* @param timestamp - the input timestamp
|
||||
* @param amount - the amount to add
|
||||
* @param unit - the unit as string
|
||||
*/
|
||||
add(this: DateAdapter<T>, timestamp: number, amount: number, unit: TimeUnit): number;
|
||||
/**
|
||||
* Returns the number of `unit` between the given timestamps.
|
||||
* @param a - the input timestamp (reference)
|
||||
* @param b - the timestamp to subtract
|
||||
* @param unit - the unit as string
|
||||
*/
|
||||
diff(this: DateAdapter<T>, a: number, b: number, unit: TimeUnit): number;
|
||||
/**
|
||||
* Returns start of `unit` for the given `timestamp`.
|
||||
* @param timestamp - the input timestamp
|
||||
* @param unit - the unit as string
|
||||
* @param [weekday] - the ISO day of the week with 1 being Monday
|
||||
* and 7 being Sunday (only needed if param *unit* is `isoWeek`).
|
||||
*/
|
||||
startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number | boolean): number;
|
||||
/**
|
||||
* Returns end of `unit` for the given `timestamp`.
|
||||
* @param timestamp - the input timestamp
|
||||
* @param unit - the unit as string
|
||||
*/
|
||||
endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit): number;
|
||||
}
|
||||
declare const _default: {
|
||||
_date: {
|
||||
new (options?: AnyObject): DateAdapter;
|
||||
override<T extends AnyObject = AnyObject>(members: Partial<Omit<DateAdapter<T>, "options">>): void;
|
||||
};
|
||||
};
|
||||
export default _default;
|
||||
@ -1,21 +0,0 @@
|
||||
export default class Animation {
|
||||
constructor(cfg: any, target: any, prop: any, to: any);
|
||||
_active: boolean;
|
||||
_fn: any;
|
||||
_easing: any;
|
||||
_start: number;
|
||||
_duration: number;
|
||||
_total: number;
|
||||
_loop: boolean;
|
||||
_target: any;
|
||||
_prop: any;
|
||||
_from: unknown;
|
||||
_to: any;
|
||||
_promises: any[];
|
||||
active(): boolean;
|
||||
update(cfg: any, to: any, date: any): void;
|
||||
cancel(): void;
|
||||
tick(date: any): void;
|
||||
wait(): Promise<any>;
|
||||
_notify(resolved: any): void;
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
export default class Animations {
|
||||
constructor(chart: any, config: any);
|
||||
_chart: any;
|
||||
_properties: Map<any, any>;
|
||||
configure(config: any): void;
|
||||
/**
|
||||
* Utility to handle animation of `options`.
|
||||
* @private
|
||||
*/
|
||||
private _animateOptions;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _createAnimations;
|
||||
/**
|
||||
* Update `target` properties to new values, using configured animations
|
||||
* @param {object} target - object to update
|
||||
* @param {object} values - new target properties
|
||||
* @returns {boolean|undefined} - `true` if animations were started
|
||||
**/
|
||||
update(target: object, values: object): boolean | undefined;
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
export function applyAnimationsDefaults(defaults: any): void;
|
||||
@ -1,67 +0,0 @@
|
||||
/**
|
||||
* @typedef { import('./core.animation.js').default } Animation
|
||||
* @typedef { import('./core.controller.js').default } Chart
|
||||
*/
|
||||
/**
|
||||
* Please use the module's default export which provides a singleton instance
|
||||
* Note: class is export for typedoc
|
||||
*/
|
||||
export class Animator {
|
||||
_request: any;
|
||||
_charts: Map<any, any>;
|
||||
_running: boolean;
|
||||
_lastDate: number;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _notify;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _refresh;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _update;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getAnims;
|
||||
/**
|
||||
* @param {Chart} chart
|
||||
* @param {string} event - event name
|
||||
* @param {Function} cb - callback
|
||||
*/
|
||||
listen(chart: Chart, event: string, cb: Function): void;
|
||||
/**
|
||||
* Add animations
|
||||
* @param {Chart} chart
|
||||
* @param {Animation[]} items - animations
|
||||
*/
|
||||
add(chart: Chart, items: Animation[]): void;
|
||||
/**
|
||||
* Counts number of active animations for the chart
|
||||
* @param {Chart} chart
|
||||
*/
|
||||
has(chart: Chart): boolean;
|
||||
/**
|
||||
* Start animating (all charts)
|
||||
* @param {Chart} chart
|
||||
*/
|
||||
start(chart: Chart): void;
|
||||
running(chart: any): boolean;
|
||||
/**
|
||||
* Stop all animations for the chart
|
||||
* @param {Chart} chart
|
||||
*/
|
||||
stop(chart: Chart): void;
|
||||
/**
|
||||
* Remove chart from Animator
|
||||
* @param {Chart} chart
|
||||
*/
|
||||
remove(chart: Chart): boolean;
|
||||
}
|
||||
declare const _default: Animator;
|
||||
export default _default;
|
||||
export type Animation = import('./core.animation.js').default;
|
||||
export type Chart = import('./core.controller.js').default;
|
||||
86
staticfiles/chart.js/dist/core/core.config.d.ts
vendored
86
staticfiles/chart.js/dist/core/core.config.d.ts
vendored
@ -1,86 +0,0 @@
|
||||
export function getIndexAxis(type: any, options: any): any;
|
||||
export function determineAxis(id: any, ...scaleOptions: any[]): any;
|
||||
export default class Config {
|
||||
constructor(config: any);
|
||||
_config: any;
|
||||
_scopeCache: Map<any, any>;
|
||||
_resolverCache: Map<any, any>;
|
||||
get platform(): any;
|
||||
set type(arg: any);
|
||||
get type(): any;
|
||||
set data(arg: any);
|
||||
get data(): any;
|
||||
set options(arg: any);
|
||||
get options(): any;
|
||||
get plugins(): any;
|
||||
update(): void;
|
||||
clearCache(): void;
|
||||
/**
|
||||
* Returns the option scope keys for resolving dataset options.
|
||||
* These keys do not include the dataset itself, because it is not under options.
|
||||
* @param {string} datasetType
|
||||
* @return {string[][]}
|
||||
*/
|
||||
datasetScopeKeys(datasetType: string): string[][];
|
||||
/**
|
||||
* Returns the option scope keys for resolving dataset animation options.
|
||||
* These keys do not include the dataset itself, because it is not under options.
|
||||
* @param {string} datasetType
|
||||
* @param {string} transition
|
||||
* @return {string[][]}
|
||||
*/
|
||||
datasetAnimationScopeKeys(datasetType: string, transition: string): string[][];
|
||||
/**
|
||||
* Returns the options scope keys for resolving element options that belong
|
||||
* to an dataset. These keys do not include the dataset itself, because it
|
||||
* is not under options.
|
||||
* @param {string} datasetType
|
||||
* @param {string} elementType
|
||||
* @return {string[][]}
|
||||
*/
|
||||
datasetElementScopeKeys(datasetType: string, elementType: string): string[][];
|
||||
/**
|
||||
* Returns the options scope keys for resolving plugin options.
|
||||
* @param {{id: string, additionalOptionScopes?: string[]}} plugin
|
||||
* @return {string[][]}
|
||||
*/
|
||||
pluginScopeKeys(plugin: {
|
||||
id: string;
|
||||
additionalOptionScopes?: string[];
|
||||
}): string[][];
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _cachedScopes;
|
||||
/**
|
||||
* Resolves the objects from options and defaults for option value resolution.
|
||||
* @param {object} mainScope - The main scope object for options
|
||||
* @param {string[][]} keyLists - The arrays of keys in resolution order
|
||||
* @param {boolean} [resetCache] - reset the cache for this mainScope
|
||||
*/
|
||||
getOptionScopes(mainScope: object, keyLists: string[][], resetCache?: boolean): any;
|
||||
/**
|
||||
* Returns the option scopes for resolving chart options
|
||||
* @return {object[]}
|
||||
*/
|
||||
chartOptionScopes(): object[];
|
||||
/**
|
||||
* @param {object[]} scopes
|
||||
* @param {string[]} names
|
||||
* @param {function|object} context
|
||||
* @param {string[]} [prefixes]
|
||||
* @return {object}
|
||||
*/
|
||||
resolveNamedOptions(scopes: object[], names: string[], context: Function | object, prefixes?: string[]): object;
|
||||
/**
|
||||
* @param {object[]} scopes
|
||||
* @param {object} [context]
|
||||
* @param {string[]} [prefixes]
|
||||
* @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]
|
||||
*/
|
||||
createResolver(scopes: object[], context?: object, prefixes?: string[], descriptorDefaults?: {
|
||||
scriptable: boolean;
|
||||
indexable: boolean;
|
||||
allKeys?: boolean;
|
||||
}): any;
|
||||
}
|
||||
257
staticfiles/chart.js/dist/core/core.controller.d.ts
vendored
257
staticfiles/chart.js/dist/core/core.controller.d.ts
vendored
@ -1,257 +0,0 @@
|
||||
export default Chart;
|
||||
export type ChartEvent = import('../types/index.js').ChartEvent;
|
||||
export type Point = import('../types/index.js').Point;
|
||||
declare class Chart {
|
||||
static defaults: import("./core.defaults.js").Defaults;
|
||||
static instances: {};
|
||||
static overrides: any;
|
||||
static registry: import("./core.registry.js").Registry;
|
||||
static version: string;
|
||||
static getChart: (key: any) => any;
|
||||
static register(...items: any[]): void;
|
||||
static unregister(...items: any[]): void;
|
||||
constructor(item: any, userConfig: any);
|
||||
config: Config;
|
||||
platform: any;
|
||||
id: number;
|
||||
ctx: any;
|
||||
canvas: any;
|
||||
width: any;
|
||||
height: any;
|
||||
_options: any;
|
||||
_aspectRatio: any;
|
||||
_layers: any[];
|
||||
_metasets: any[];
|
||||
_stacks: any;
|
||||
boxes: any[];
|
||||
currentDevicePixelRatio: any;
|
||||
chartArea: any;
|
||||
_active: any[];
|
||||
_lastEvent: import("../types/index.js").ChartEvent;
|
||||
_listeners: {};
|
||||
/** @type {?{attach?: function, detach?: function, resize?: function}} */
|
||||
_responsiveListeners: {
|
||||
attach?: Function;
|
||||
detach?: Function;
|
||||
resize?: Function;
|
||||
};
|
||||
_sortedMetasets: any[];
|
||||
scales: {};
|
||||
_plugins: PluginService;
|
||||
$proxies: {};
|
||||
_hiddenIndices: {};
|
||||
attached: boolean;
|
||||
_animationsDisabled: boolean;
|
||||
$context: {
|
||||
chart: Chart;
|
||||
type: string;
|
||||
};
|
||||
_doResize: (mode?: any) => number;
|
||||
_dataChanges: any[];
|
||||
get aspectRatio(): any;
|
||||
set data(arg: any);
|
||||
get data(): any;
|
||||
set options(arg: any);
|
||||
get options(): any;
|
||||
get registry(): import("./core.registry.js").Registry;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _initialize;
|
||||
clear(): Chart;
|
||||
stop(): Chart;
|
||||
/**
|
||||
* Resize the chart to its container or to explicit dimensions.
|
||||
* @param {number} [width]
|
||||
* @param {number} [height]
|
||||
*/
|
||||
resize(width?: number, height?: number): void;
|
||||
_resizeBeforeDraw: {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
_resize(width: any, height: any): void;
|
||||
ensureScalesHaveIDs(): void;
|
||||
/**
|
||||
* Builds a map of scale ID to scale object for future lookup.
|
||||
*/
|
||||
buildOrUpdateScales(): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _updateMetasets;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _removeUnreferencedMetasets;
|
||||
buildOrUpdateControllers(): any[];
|
||||
/**
|
||||
* Reset the elements of all datasets
|
||||
* @private
|
||||
*/
|
||||
private _resetElements;
|
||||
/**
|
||||
* Resets the chart back to its state before the initial animation
|
||||
*/
|
||||
reset(): void;
|
||||
update(mode: any): void;
|
||||
_minPadding: number;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _updateScales;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _checkEventBindings;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _updateHiddenIndices;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getUniformDataChanges;
|
||||
/**
|
||||
* Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
|
||||
* hook, in which case, plugins will not be called on `afterLayout`.
|
||||
* @private
|
||||
*/
|
||||
private _updateLayout;
|
||||
/**
|
||||
* Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
|
||||
* hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
|
||||
* @private
|
||||
*/
|
||||
private _updateDatasets;
|
||||
/**
|
||||
* Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`
|
||||
* hook, in which case, plugins will not be called on `afterDatasetUpdate`.
|
||||
* @private
|
||||
*/
|
||||
private _updateDataset;
|
||||
render(): void;
|
||||
draw(): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getSortedDatasetMetas;
|
||||
/**
|
||||
* Gets the visible dataset metas in drawing order
|
||||
* @return {object[]}
|
||||
*/
|
||||
getSortedVisibleDatasetMetas(): object[];
|
||||
/**
|
||||
* Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
|
||||
* hook, in which case, plugins will not be called on `afterDatasetsDraw`.
|
||||
* @private
|
||||
*/
|
||||
private _drawDatasets;
|
||||
/**
|
||||
* Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`
|
||||
* hook, in which case, plugins will not be called on `afterDatasetDraw`.
|
||||
* @private
|
||||
*/
|
||||
private _drawDataset;
|
||||
/**
|
||||
* Checks whether the given point is in the chart area.
|
||||
* @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isPointInArea(point: Point): boolean;
|
||||
getElementsAtEventForMode(e: any, mode: any, options: any, useFinalPosition: any): any;
|
||||
getDatasetMeta(datasetIndex: any): any;
|
||||
getContext(): {
|
||||
chart: Chart;
|
||||
type: string;
|
||||
};
|
||||
getVisibleDatasetCount(): number;
|
||||
isDatasetVisible(datasetIndex: any): boolean;
|
||||
setDatasetVisibility(datasetIndex: any, visible: any): void;
|
||||
toggleDataVisibility(index: any): void;
|
||||
getDataVisibility(index: any): boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _updateVisibility;
|
||||
hide(datasetIndex: any, dataIndex: any): void;
|
||||
show(datasetIndex: any, dataIndex: any): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _destroyDatasetMeta;
|
||||
_stop(): void;
|
||||
destroy(): void;
|
||||
toBase64Image(...args: any[]): any;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private bindEvents;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private bindUserEvents;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private bindResponsiveEvents;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private unbindEvents;
|
||||
updateHoverStyle(items: any, mode: any, enabled: any): void;
|
||||
/**
|
||||
* Get active (hovered) elements
|
||||
* @returns array
|
||||
*/
|
||||
getActiveElements(): any[];
|
||||
/**
|
||||
* Set active (hovered) elements
|
||||
* @param {array} activeElements New active data points
|
||||
*/
|
||||
setActiveElements(activeElements: any[]): void;
|
||||
/**
|
||||
* Calls enabled plugins on the specified hook and with the given args.
|
||||
* This method immediately returns as soon as a plugin explicitly returns false. The
|
||||
* returned value can be used, for instance, to interrupt the current action.
|
||||
* @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
|
||||
* @param {Object} [args] - Extra arguments to apply to the hook call.
|
||||
* @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified
|
||||
* @returns {boolean} false if any of the plugins return false, else returns true.
|
||||
*/
|
||||
notifyPlugins(hook: string, args?: any, filter?: import('./core.plugins.js').filterCallback): boolean;
|
||||
/**
|
||||
* Check if a plugin with the specific ID is registered and enabled
|
||||
* @param {string} pluginId - The ID of the plugin of which to check if it is enabled
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isPluginEnabled(pluginId: string): boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _updateHoverStyles;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _eventHandler;
|
||||
/**
|
||||
* Handle an event
|
||||
* @param {ChartEvent} e the event to handle
|
||||
* @param {boolean} [replay] - true if the event was replayed by `update`
|
||||
* @param {boolean} [inChartArea] - true if the event is inside chartArea
|
||||
* @return {boolean} true if the chart needs to re-render
|
||||
* @private
|
||||
*/
|
||||
private _handleEvent;
|
||||
/**
|
||||
* @param {ChartEvent} e - The event
|
||||
* @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements
|
||||
* @param {boolean} inChartArea - Is the event inside chartArea
|
||||
* @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions
|
||||
* @returns {import('../types/index.js').ActiveElement[]} - The active elements
|
||||
* @pravate
|
||||
*/
|
||||
_getActiveElements(e: ChartEvent, lastActive: import('../types/index.js').ActiveElement[], inChartArea: boolean, useFinalPosition: boolean): import('../types/index.js').ActiveElement[];
|
||||
}
|
||||
import Config from "./core.config.js";
|
||||
import PluginService from "./core.plugins.js";
|
||||
@ -1,251 +0,0 @@
|
||||
export default class DatasetController {
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static defaults: any;
|
||||
/**
|
||||
* Element type used to generate a meta dataset (e.g. Chart.element.LineElement).
|
||||
*/
|
||||
static datasetElementType: any;
|
||||
/**
|
||||
* Element type used to generate a meta data (e.g. Chart.element.PointElement).
|
||||
*/
|
||||
static dataElementType: any;
|
||||
/**
|
||||
* @param {Chart} chart
|
||||
* @param {number} datasetIndex
|
||||
*/
|
||||
constructor(chart: Chart, datasetIndex: number);
|
||||
chart: import("./core.controller.js").default;
|
||||
_ctx: any;
|
||||
index: number;
|
||||
_cachedDataOpts: {};
|
||||
_cachedMeta: any;
|
||||
_type: any;
|
||||
options: any;
|
||||
/** @type {boolean | object} */
|
||||
_parsing: boolean | object;
|
||||
_data: any;
|
||||
_objectData: any;
|
||||
_sharedOptions: any;
|
||||
_drawStart: any;
|
||||
_drawCount: any;
|
||||
enableOptionSharing: boolean;
|
||||
supportsDecimation: boolean;
|
||||
$context: any;
|
||||
_syncList: any[];
|
||||
datasetElementType: any;
|
||||
dataElementType: any;
|
||||
initialize(): void;
|
||||
updateIndex(datasetIndex: any): void;
|
||||
linkScales(): void;
|
||||
getDataset(): any;
|
||||
getMeta(): any;
|
||||
/**
|
||||
* @param {string} scaleID
|
||||
* @return {Scale}
|
||||
*/
|
||||
getScaleForId(scaleID: string): Scale;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getOtherScale;
|
||||
reset(): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _destroy;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _dataCheck;
|
||||
addElements(): void;
|
||||
buildOrUpdateElements(resetNewElements: any): void;
|
||||
/**
|
||||
* Merges user-supplied and default dataset-level options
|
||||
* @private
|
||||
*/
|
||||
private configure;
|
||||
/**
|
||||
* @param {number} start
|
||||
* @param {number} count
|
||||
*/
|
||||
parse(start: number, count: number): void;
|
||||
/**
|
||||
* Parse array of primitive values
|
||||
* @param {object} meta - dataset meta
|
||||
* @param {array} data - data array. Example [1,3,4]
|
||||
* @param {number} start - start index
|
||||
* @param {number} count - number of items to parse
|
||||
* @returns {object} parsed item - item containing index and a parsed value
|
||||
* for each scale id.
|
||||
* Example: {xScale0: 0, yScale0: 1}
|
||||
* @protected
|
||||
*/
|
||||
protected parsePrimitiveData(meta: object, data: any[], start: number, count: number): object;
|
||||
/**
|
||||
* Parse array of arrays
|
||||
* @param {object} meta - dataset meta
|
||||
* @param {array} data - data array. Example [[1,2],[3,4]]
|
||||
* @param {number} start - start index
|
||||
* @param {number} count - number of items to parse
|
||||
* @returns {object} parsed item - item containing index and a parsed value
|
||||
* for each scale id.
|
||||
* Example: {x: 0, y: 1}
|
||||
* @protected
|
||||
*/
|
||||
protected parseArrayData(meta: object, data: any[], start: number, count: number): object;
|
||||
/**
|
||||
* Parse array of objects
|
||||
* @param {object} meta - dataset meta
|
||||
* @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]
|
||||
* @param {number} start - start index
|
||||
* @param {number} count - number of items to parse
|
||||
* @returns {object} parsed item - item containing index and a parsed value
|
||||
* for each scale id. _custom is optional
|
||||
* Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}
|
||||
* @protected
|
||||
*/
|
||||
protected parseObjectData(meta: object, data: any[], start: number, count: number): object;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getParsed(index: any): any;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getDataElement(index: any): any;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected applyStack(scale: any, parsed: any, mode: any): any;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected updateRangeFromParsed(range: any, scale: any, parsed: any, stack: any): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getMinMax(scale: any, canStack: any): {
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
getAllParsedValues(scale: any): number[];
|
||||
/**
|
||||
* @return {number|boolean}
|
||||
* @protected
|
||||
*/
|
||||
protected getMaxOverflow(): number | boolean;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getLabelAndValue(index: any): {
|
||||
label: string;
|
||||
value: string;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _update;
|
||||
/**
|
||||
* @param {string} mode
|
||||
*/
|
||||
update(mode: string): void;
|
||||
draw(): void;
|
||||
/**
|
||||
* Returns a set of predefined style properties that should be used to represent the dataset
|
||||
* or the data if the index is specified
|
||||
* @param {number} index - data index
|
||||
* @param {boolean} [active] - true if hover
|
||||
* @return {object} style object
|
||||
*/
|
||||
getStyle(index: number, active?: boolean): object;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getContext(index: any, active: any, mode: any): any;
|
||||
/**
|
||||
* @param {string} [mode]
|
||||
* @protected
|
||||
*/
|
||||
protected resolveDatasetElementOptions(mode?: string): any;
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {string} [mode]
|
||||
* @protected
|
||||
*/
|
||||
protected resolveDataElementOptions(index: number, mode?: string): any;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _resolveElementOptions;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _resolveAnimations;
|
||||
/**
|
||||
* Utility for getting the options object shared between elements
|
||||
* @protected
|
||||
*/
|
||||
protected getSharedOptions(options: any): any;
|
||||
/**
|
||||
* Utility for determining if `options` should be included in the updated properties
|
||||
* @protected
|
||||
*/
|
||||
protected includeOptions(mode: any, sharedOptions: any): boolean;
|
||||
/**
|
||||
* @todo v4, rename to getSharedOptions and remove excess functions
|
||||
*/
|
||||
_getSharedOptions(start: any, mode: any): {
|
||||
sharedOptions: any;
|
||||
includeOptions: boolean;
|
||||
};
|
||||
/**
|
||||
* Utility for updating an element with new properties, using animations when appropriate.
|
||||
* @protected
|
||||
*/
|
||||
protected updateElement(element: any, index: any, properties: any, mode: any): void;
|
||||
/**
|
||||
* Utility to animate the shared options, that are potentially affecting multiple elements.
|
||||
* @protected
|
||||
*/
|
||||
protected updateSharedOptions(sharedOptions: any, mode: any, newOptions: any): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _setStyle;
|
||||
removeHoverStyle(element: any, datasetIndex: any, index: any): void;
|
||||
setHoverStyle(element: any, datasetIndex: any, index: any): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _removeDatasetHoverStyle;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _setDatasetHoverStyle;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _resyncElements;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _insertElements;
|
||||
updateElements(element: any, start: any, count: any, mode: any): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _removeElements;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _sync;
|
||||
_onDataPush(...args: any[]): void;
|
||||
_onDataPop(): void;
|
||||
_onDataShift(): void;
|
||||
_onDataSplice(start: any, count: any, ...args: any[]): void;
|
||||
_onDataUnshift(...args: any[]): void;
|
||||
}
|
||||
export type Chart = import('./core.controller.js').default;
|
||||
export type Scale = import('./core.scale.js').default;
|
||||
@ -1,80 +0,0 @@
|
||||
export const overrides: any;
|
||||
export const descriptors: any;
|
||||
/**
|
||||
* Please use the module's default export which provides a singleton instance
|
||||
* Note: class is exported for typedoc
|
||||
*/
|
||||
export class Defaults {
|
||||
constructor(_descriptors: any, _appliers: any);
|
||||
animation: any;
|
||||
backgroundColor: string;
|
||||
borderColor: string;
|
||||
color: string;
|
||||
datasets: {};
|
||||
devicePixelRatio: (context: any) => any;
|
||||
elements: {};
|
||||
events: string[];
|
||||
font: {
|
||||
family: string;
|
||||
size: number;
|
||||
style: string;
|
||||
lineHeight: number;
|
||||
weight: any;
|
||||
};
|
||||
hover: {};
|
||||
hoverBackgroundColor: (ctx: any, options: any) => CanvasGradient;
|
||||
hoverBorderColor: (ctx: any, options: any) => CanvasGradient;
|
||||
hoverColor: (ctx: any, options: any) => CanvasGradient;
|
||||
indexAxis: string;
|
||||
interaction: {
|
||||
mode: string;
|
||||
intersect: boolean;
|
||||
includeInvisible: boolean;
|
||||
};
|
||||
maintainAspectRatio: boolean;
|
||||
onHover: any;
|
||||
onClick: any;
|
||||
parsing: boolean;
|
||||
plugins: {};
|
||||
responsive: boolean;
|
||||
scale: any;
|
||||
scales: {};
|
||||
showLine: boolean;
|
||||
drawActiveElementsOnTop: boolean;
|
||||
/**
|
||||
* @param {string|object} scope
|
||||
* @param {object} [values]
|
||||
*/
|
||||
set(scope: string | object, values?: object): any;
|
||||
/**
|
||||
* @param {string} scope
|
||||
*/
|
||||
get(scope: string): any;
|
||||
/**
|
||||
* @param {string|object} scope
|
||||
* @param {object} [values]
|
||||
*/
|
||||
describe(scope: string | object, values?: object): any;
|
||||
override(scope: any, values: any): any;
|
||||
/**
|
||||
* Routes the named defaults to fallback to another scope/name.
|
||||
* This routing is useful when those target values, like defaults.color, are changed runtime.
|
||||
* If the values would be copied, the runtime change would not take effect. By routing, the
|
||||
* fallback is evaluated at each access, so its always up to date.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* defaults.route('elements.arc', 'backgroundColor', '', 'color')
|
||||
* - reads the backgroundColor from defaults.color when undefined locally
|
||||
*
|
||||
* @param {string} scope Scope this route applies to.
|
||||
* @param {string} name Property name that should be routed to different namespace when not defined here.
|
||||
* @param {string} targetScope The namespace where those properties should be routed to.
|
||||
* Empty string ('') is the root of defaults.
|
||||
* @param {string} targetName The target name in the target scope the property should be routed to.
|
||||
*/
|
||||
route(scope: string, name: string, targetScope: string, targetName: string): void;
|
||||
apply(appliers: any): void;
|
||||
}
|
||||
declare const _default: Defaults;
|
||||
export default _default;
|
||||
21
staticfiles/chart.js/dist/core/core.element.d.ts
vendored
21
staticfiles/chart.js/dist/core/core.element.d.ts
vendored
@ -1,21 +0,0 @@
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { Point } from '../types/geometric.js';
|
||||
import type { Animation } from '../types/animation.js';
|
||||
export default class Element<T = AnyObject, O = AnyObject> {
|
||||
static defaults: {};
|
||||
static defaultRoutes: any;
|
||||
x: number;
|
||||
y: number;
|
||||
active: boolean;
|
||||
options: O;
|
||||
$animations: Record<keyof T, Animation>;
|
||||
tooltipPosition(useFinalPosition: boolean): Point;
|
||||
hasValue(): boolean;
|
||||
/**
|
||||
* Gets the current or final value of each prop. Can return extra properties (whole object).
|
||||
* @param props - properties to get
|
||||
* @param [final] - get the final value (animation target)
|
||||
*/
|
||||
getProps<P extends (keyof T)[]>(props: P, final?: boolean): Pick<T, P[number]>;
|
||||
getProps<P extends string>(props: P[], final?: boolean): Partial<Record<P, unknown>>;
|
||||
}
|
||||
@ -1,92 +0,0 @@
|
||||
declare namespace _default {
|
||||
export { evaluateInteractionItems };
|
||||
export namespace modes {
|
||||
/**
|
||||
* Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something
|
||||
* If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item
|
||||
* @function Chart.Interaction.modes.index
|
||||
* @since v2.4.0
|
||||
* @param {Chart} chart - the chart we are returning items from
|
||||
* @param {Event} e - the event we are find things at
|
||||
* @param {InteractionOptions} options - options to use
|
||||
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
||||
* @return {InteractionItem[]} - items that are found
|
||||
*/
|
||||
function index(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
||||
/**
|
||||
* Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something
|
||||
* If the options.intersect is false, we find the nearest item and return the items in that dataset
|
||||
* @function Chart.Interaction.modes.dataset
|
||||
* @param {Chart} chart - the chart we are returning items from
|
||||
* @param {Event} e - the event we are find things at
|
||||
* @param {InteractionOptions} options - options to use
|
||||
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
||||
* @return {InteractionItem[]} - items that are found
|
||||
*/
|
||||
function dataset(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
||||
/**
|
||||
* Point mode returns all elements that hit test based on the event position
|
||||
* of the event
|
||||
* @function Chart.Interaction.modes.intersect
|
||||
* @param {Chart} chart - the chart we are returning items from
|
||||
* @param {Event} e - the event we are find things at
|
||||
* @param {InteractionOptions} options - options to use
|
||||
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
||||
* @return {InteractionItem[]} - items that are found
|
||||
*/
|
||||
function point(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
||||
/**
|
||||
* nearest mode returns the element closest to the point
|
||||
* @function Chart.Interaction.modes.intersect
|
||||
* @param {Chart} chart - the chart we are returning items from
|
||||
* @param {Event} e - the event we are find things at
|
||||
* @param {InteractionOptions} options - options to use
|
||||
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
||||
* @return {InteractionItem[]} - items that are found
|
||||
*/
|
||||
function nearest(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
||||
/**
|
||||
* x mode returns the elements that hit-test at the current x coordinate
|
||||
* @function Chart.Interaction.modes.x
|
||||
* @param {Chart} chart - the chart we are returning items from
|
||||
* @param {Event} e - the event we are find things at
|
||||
* @param {InteractionOptions} options - options to use
|
||||
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
||||
* @return {InteractionItem[]} - items that are found
|
||||
*/
|
||||
function x(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
||||
/**
|
||||
* y mode returns the elements that hit-test at the current y coordinate
|
||||
* @function Chart.Interaction.modes.y
|
||||
* @param {Chart} chart - the chart we are returning items from
|
||||
* @param {Event} e - the event we are find things at
|
||||
* @param {InteractionOptions} options - options to use
|
||||
* @param {boolean} [useFinalPosition] - use final element position (animation target)
|
||||
* @return {InteractionItem[]} - items that are found
|
||||
*/
|
||||
function y(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[];
|
||||
}
|
||||
}
|
||||
export default _default;
|
||||
export type Chart = import('./core.controller.js').default;
|
||||
export type ChartEvent = import('../types/index.js').ChartEvent;
|
||||
export type InteractionOptions = {
|
||||
axis?: string;
|
||||
intersect?: boolean;
|
||||
includeInvisible?: boolean;
|
||||
};
|
||||
export type InteractionItem = {
|
||||
datasetIndex: number;
|
||||
index: number;
|
||||
element: import('./core.element.js').default;
|
||||
};
|
||||
export type Point = import('../types/index.js').Point;
|
||||
/**
|
||||
* Helper function to select candidate elements for interaction
|
||||
* @param {Chart} chart - the chart
|
||||
* @param {string} axis - the axis mode. x|y|xy|r
|
||||
* @param {Point} position - the point to be nearest to, in relative coordinates
|
||||
* @param {function} handler - the callback to execute for each visible item
|
||||
* @param {boolean} [intersect] - consider intersecting items
|
||||
*/
|
||||
declare function evaluateInteractionItems(chart: Chart, axis: string, position: Point, handler: Function, intersect?: boolean): void;
|
||||
88
staticfiles/chart.js/dist/core/core.layouts.d.ts
vendored
88
staticfiles/chart.js/dist/core/core.layouts.d.ts
vendored
@ -1,88 +0,0 @@
|
||||
declare namespace _default {
|
||||
/**
|
||||
* Register a box to a chart.
|
||||
* A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.
|
||||
* @param {Chart} chart - the chart to use
|
||||
* @param {LayoutItem} item - the item to add to be laid out
|
||||
*/
|
||||
function addBox(chart: import("./core.controller.js").default, item: LayoutItem): void;
|
||||
/**
|
||||
* Remove a layoutItem from a chart
|
||||
* @param {Chart} chart - the chart to remove the box from
|
||||
* @param {LayoutItem} layoutItem - the item to remove from the layout
|
||||
*/
|
||||
function removeBox(chart: import("./core.controller.js").default, layoutItem: LayoutItem): void;
|
||||
/**
|
||||
* Sets (or updates) options on the given `item`.
|
||||
* @param {Chart} chart - the chart in which the item lives (or will be added to)
|
||||
* @param {LayoutItem} item - the item to configure with the given options
|
||||
* @param {object} options - the new item options.
|
||||
*/
|
||||
function configure(chart: import("./core.controller.js").default, item: LayoutItem, options: any): void;
|
||||
/**
|
||||
* Fits boxes of the given chart into the given size by having each box measure itself
|
||||
* then running a fitting algorithm
|
||||
* @param {Chart} chart - the chart
|
||||
* @param {number} width - the width to fit into
|
||||
* @param {number} height - the height to fit into
|
||||
* @param {number} minPadding - minimum padding required for each side of chart area
|
||||
*/
|
||||
function update(chart: import("./core.controller.js").default, width: number, height: number, minPadding: number): void;
|
||||
}
|
||||
export default _default;
|
||||
export type Chart = import('./core.controller.js').default;
|
||||
export type LayoutItem = {
|
||||
/**
|
||||
* - The position of the item in the chart layout. Possible values are
|
||||
* 'left', 'top', 'right', 'bottom', and 'chartArea'
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* - The weight used to sort the item. Higher weights are further away from the chart area
|
||||
*/
|
||||
weight: number;
|
||||
/**
|
||||
* - if true, and the item is horizontal, then push vertical boxes down
|
||||
*/
|
||||
fullSize: boolean;
|
||||
/**
|
||||
* - returns true if the layout item is horizontal (ie. top or bottom)
|
||||
*/
|
||||
isHorizontal: Function;
|
||||
/**
|
||||
* - Takes two parameters: width and height. Returns size of item
|
||||
*/
|
||||
update: Function;
|
||||
/**
|
||||
* - Draws the element
|
||||
*/
|
||||
draw: Function;
|
||||
/**
|
||||
* - Returns an object with padding on the edges
|
||||
*/
|
||||
getPadding?: Function;
|
||||
/**
|
||||
* - Width of item. Must be valid after update()
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* - Height of item. Must be valid after update()
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* - Left edge of the item. Set by layout system and cannot be used in update
|
||||
*/
|
||||
left: number;
|
||||
/**
|
||||
* - Top edge of the item. Set by layout system and cannot be used in update
|
||||
*/
|
||||
top: number;
|
||||
/**
|
||||
* - Right edge of the item. Set by layout system and cannot be used in update
|
||||
*/
|
||||
right: number;
|
||||
/**
|
||||
* - Bottom edge of the item. Set by layout system and cannot be used in update
|
||||
*/
|
||||
bottom: number;
|
||||
};
|
||||
@ -1 +0,0 @@
|
||||
export function applyLayoutsDefaults(defaults: any): void;
|
||||
64
staticfiles/chart.js/dist/core/core.plugins.d.ts
vendored
64
staticfiles/chart.js/dist/core/core.plugins.d.ts
vendored
@ -1,64 +0,0 @@
|
||||
/**
|
||||
* @typedef { import('./core.controller.js').default } Chart
|
||||
* @typedef { import('../types/index.js').ChartEvent } ChartEvent
|
||||
* @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip
|
||||
*/
|
||||
/**
|
||||
* @callback filterCallback
|
||||
* @param {{plugin: object, options: object}} value
|
||||
* @param {number} [index]
|
||||
* @param {array} [array]
|
||||
* @param {object} [thisArg]
|
||||
* @return {boolean}
|
||||
*/
|
||||
export default class PluginService {
|
||||
_init: {
|
||||
plugin: any;
|
||||
options: any;
|
||||
}[];
|
||||
/**
|
||||
* Calls enabled plugins for `chart` on the specified hook and with the given args.
|
||||
* This method immediately returns as soon as a plugin explicitly returns false. The
|
||||
* returned value can be used, for instance, to interrupt the current action.
|
||||
* @param {Chart} chart - The chart instance for which plugins should be called.
|
||||
* @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
|
||||
* @param {object} [args] - Extra arguments to apply to the hook call.
|
||||
* @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified
|
||||
* @returns {boolean} false if any of the plugins return false, else returns true.
|
||||
*/
|
||||
notify(chart: Chart, hook: string, args?: object, filter?: filterCallback): boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _notify;
|
||||
invalidate(): void;
|
||||
_oldCache: {
|
||||
plugin: any;
|
||||
options: any;
|
||||
}[];
|
||||
_cache: {
|
||||
plugin: any;
|
||||
options: any;
|
||||
}[];
|
||||
/**
|
||||
* @param {Chart} chart
|
||||
* @private
|
||||
*/
|
||||
private _descriptors;
|
||||
_createDescriptors(chart: any, all: any): {
|
||||
plugin: any;
|
||||
options: any;
|
||||
}[];
|
||||
/**
|
||||
* @param {Chart} chart
|
||||
* @private
|
||||
*/
|
||||
private _notifyStateChanges;
|
||||
}
|
||||
export type Chart = import('./core.controller.js').default;
|
||||
export type ChartEvent = import('../types/index.js').ChartEvent;
|
||||
export type Tooltip = any;
|
||||
export type filterCallback = (value: {
|
||||
plugin: object;
|
||||
options: object;
|
||||
}, index?: number, array?: any[], thisArg?: object) => boolean;
|
||||
@ -1,90 +0,0 @@
|
||||
/**
|
||||
* Please use the module's default export which provides a singleton instance
|
||||
* Note: class is exported for typedoc
|
||||
*/
|
||||
export class Registry {
|
||||
controllers: TypedRegistry;
|
||||
elements: TypedRegistry;
|
||||
plugins: TypedRegistry;
|
||||
scales: TypedRegistry;
|
||||
_typedRegistries: TypedRegistry[];
|
||||
/**
|
||||
* @param {...any} args
|
||||
*/
|
||||
add(...args: any[]): void;
|
||||
remove(...args: any[]): void;
|
||||
/**
|
||||
* @param {...typeof DatasetController} args
|
||||
*/
|
||||
addControllers(...args: (typeof DatasetController)[]): void;
|
||||
/**
|
||||
* @param {...typeof Element} args
|
||||
*/
|
||||
addElements(...args: (typeof Element)[]): void;
|
||||
/**
|
||||
* @param {...any} args
|
||||
*/
|
||||
addPlugins(...args: any[]): void;
|
||||
/**
|
||||
* @param {...typeof Scale} args
|
||||
*/
|
||||
addScales(...args: (typeof Scale)[]): void;
|
||||
/**
|
||||
* @param {string} id
|
||||
* @returns {typeof DatasetController}
|
||||
*/
|
||||
getController(id: string): typeof DatasetController;
|
||||
/**
|
||||
* @param {string} id
|
||||
* @returns {typeof Element}
|
||||
*/
|
||||
getElement(id: string): typeof Element;
|
||||
/**
|
||||
* @param {string} id
|
||||
* @returns {object}
|
||||
*/
|
||||
getPlugin(id: string): object;
|
||||
/**
|
||||
* @param {string} id
|
||||
* @returns {typeof Scale}
|
||||
*/
|
||||
getScale(id: string): typeof Scale;
|
||||
/**
|
||||
* @param {...typeof DatasetController} args
|
||||
*/
|
||||
removeControllers(...args: (typeof DatasetController)[]): void;
|
||||
/**
|
||||
* @param {...typeof Element} args
|
||||
*/
|
||||
removeElements(...args: (typeof Element)[]): void;
|
||||
/**
|
||||
* @param {...any} args
|
||||
*/
|
||||
removePlugins(...args: any[]): void;
|
||||
/**
|
||||
* @param {...typeof Scale} args
|
||||
*/
|
||||
removeScales(...args: (typeof Scale)[]): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _each;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _exec;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _getRegistryForType;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _get;
|
||||
}
|
||||
declare const _default: Registry;
|
||||
export default _default;
|
||||
import TypedRegistry from "./core.typedRegistry.js";
|
||||
import DatasetController from "./core.datasetController.js";
|
||||
import Element from "./core.element.js";
|
||||
import Scale from "./core.scale.js";
|
||||
@ -1,19 +0,0 @@
|
||||
/**
|
||||
* @typedef { import('./core.controller.js').default } Chart
|
||||
* @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick
|
||||
*/
|
||||
/**
|
||||
* Returns a subset of ticks to be plotted to avoid overlapping labels.
|
||||
* @param {import('./core.scale.js').default} scale
|
||||
* @param {Tick[]} ticks
|
||||
* @return {Tick[]}
|
||||
* @private
|
||||
*/
|
||||
export function autoSkip(scale: import('./core.scale.js').default, ticks: Tick[]): Tick[];
|
||||
export type Chart = import('./core.controller.js').default;
|
||||
export type Tick = {
|
||||
value: number | string;
|
||||
label?: string;
|
||||
major?: boolean;
|
||||
$context?: any;
|
||||
};
|
||||
343
staticfiles/chart.js/dist/core/core.scale.d.ts
vendored
343
staticfiles/chart.js/dist/core/core.scale.d.ts
vendored
@ -1,343 +0,0 @@
|
||||
export default class Scale extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> {
|
||||
constructor(cfg: any);
|
||||
/** @type {string} */
|
||||
id: string;
|
||||
/** @type {string} */
|
||||
type: string;
|
||||
/** @type {any} */
|
||||
options: any;
|
||||
/** @type {CanvasRenderingContext2D} */
|
||||
ctx: CanvasRenderingContext2D;
|
||||
/** @type {Chart} */
|
||||
chart: Chart;
|
||||
/** @type {number} */
|
||||
top: number;
|
||||
/** @type {number} */
|
||||
bottom: number;
|
||||
/** @type {number} */
|
||||
left: number;
|
||||
/** @type {number} */
|
||||
right: number;
|
||||
/** @type {number} */
|
||||
width: number;
|
||||
/** @type {number} */
|
||||
height: number;
|
||||
_margins: {
|
||||
left: number;
|
||||
right: number;
|
||||
top: number;
|
||||
bottom: number;
|
||||
};
|
||||
/** @type {number} */
|
||||
maxWidth: number;
|
||||
/** @type {number} */
|
||||
maxHeight: number;
|
||||
/** @type {number} */
|
||||
paddingTop: number;
|
||||
/** @type {number} */
|
||||
paddingBottom: number;
|
||||
/** @type {number} */
|
||||
paddingLeft: number;
|
||||
/** @type {number} */
|
||||
paddingRight: number;
|
||||
/** @type {string=} */
|
||||
axis: string | undefined;
|
||||
/** @type {number=} */
|
||||
labelRotation: number | undefined;
|
||||
min: any;
|
||||
max: any;
|
||||
_range: {
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
/** @type {Tick[]} */
|
||||
ticks: Tick[];
|
||||
/** @type {object[]|null} */
|
||||
_gridLineItems: object[] | null;
|
||||
/** @type {object[]|null} */
|
||||
_labelItems: object[] | null;
|
||||
/** @type {object|null} */
|
||||
_labelSizes: object | null;
|
||||
_length: number;
|
||||
_maxLength: number;
|
||||
_longestTextCache: {};
|
||||
/** @type {number} */
|
||||
_startPixel: number;
|
||||
/** @type {number} */
|
||||
_endPixel: number;
|
||||
_reversePixels: boolean;
|
||||
_userMax: any;
|
||||
_userMin: any;
|
||||
_suggestedMax: any;
|
||||
_suggestedMin: any;
|
||||
_ticksLength: number;
|
||||
_borderValue: number;
|
||||
_cache: {};
|
||||
_dataLimitsCached: boolean;
|
||||
$context: any;
|
||||
/**
|
||||
* @param {any} options
|
||||
* @since 3.0
|
||||
*/
|
||||
init(options: any): void;
|
||||
/**
|
||||
* Parse a supported input value to internal representation.
|
||||
* @param {*} raw
|
||||
* @param {number} [index]
|
||||
* @since 3.0
|
||||
*/
|
||||
parse(raw: any, index?: number): any;
|
||||
/**
|
||||
* @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}
|
||||
* @protected
|
||||
* @since 3.0
|
||||
*/
|
||||
protected getUserBounds(): {
|
||||
min: number;
|
||||
max: number;
|
||||
minDefined: boolean;
|
||||
maxDefined: boolean;
|
||||
};
|
||||
/**
|
||||
* @param {boolean} canStack
|
||||
* @return {{min: number, max: number}}
|
||||
* @protected
|
||||
* @since 3.0
|
||||
*/
|
||||
protected getMinMax(canStack: boolean): {
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
/**
|
||||
* Get the padding needed for the scale
|
||||
* @return {{top: number, left: number, bottom: number, right: number}} the necessary padding
|
||||
* @private
|
||||
*/
|
||||
private getPadding;
|
||||
/**
|
||||
* Returns the scale tick objects
|
||||
* @return {Tick[]}
|
||||
* @since 2.7
|
||||
*/
|
||||
getTicks(): Tick[];
|
||||
/**
|
||||
* @return {string[]}
|
||||
*/
|
||||
getLabels(): string[];
|
||||
/**
|
||||
* @return {import('../types.js').LabelItem[]}
|
||||
*/
|
||||
getLabelItems(chartArea?: import("../types.js").ChartArea): import('../types.js').LabelItem[];
|
||||
beforeLayout(): void;
|
||||
beforeUpdate(): void;
|
||||
/**
|
||||
* @param {number} maxWidth - the max width in pixels
|
||||
* @param {number} maxHeight - the max height in pixels
|
||||
* @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart
|
||||
* This space comes from two sources:
|
||||
* - padding - space that's required to show the labels at the edges of the scale
|
||||
* - thickness of scales or legends in another orientation
|
||||
*/
|
||||
update(maxWidth: number, maxHeight: number, margins: {
|
||||
top: number;
|
||||
left: number;
|
||||
bottom: number;
|
||||
right: number;
|
||||
}): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected configure(): void;
|
||||
_alignToPixels: any;
|
||||
afterUpdate(): void;
|
||||
beforeSetDimensions(): void;
|
||||
setDimensions(): void;
|
||||
afterSetDimensions(): void;
|
||||
_callHooks(name: any): void;
|
||||
beforeDataLimits(): void;
|
||||
determineDataLimits(): void;
|
||||
afterDataLimits(): void;
|
||||
beforeBuildTicks(): void;
|
||||
/**
|
||||
* @return {object[]} the ticks
|
||||
*/
|
||||
buildTicks(): object[];
|
||||
afterBuildTicks(): void;
|
||||
beforeTickToLabelConversion(): void;
|
||||
/**
|
||||
* Convert ticks to label strings
|
||||
* @param {Tick[]} ticks
|
||||
*/
|
||||
generateTickLabels(ticks: Tick[]): void;
|
||||
afterTickToLabelConversion(): void;
|
||||
beforeCalculateLabelRotation(): void;
|
||||
calculateLabelRotation(): void;
|
||||
afterCalculateLabelRotation(): void;
|
||||
afterAutoSkip(): void;
|
||||
beforeFit(): void;
|
||||
fit(): void;
|
||||
_calculatePadding(first: any, last: any, sin: any, cos: any): void;
|
||||
/**
|
||||
* Handle margins and padding interactions
|
||||
* @private
|
||||
*/
|
||||
private _handleMargins;
|
||||
afterFit(): void;
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
isHorizontal(): boolean;
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
isFullSize(): boolean;
|
||||
/**
|
||||
* @param {Tick[]} ticks
|
||||
* @private
|
||||
*/
|
||||
private _convertTicksToLabels;
|
||||
/**
|
||||
* @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}
|
||||
* @private
|
||||
*/
|
||||
private _getLabelSizes;
|
||||
/**
|
||||
* Returns {width, height, offset} objects for the first, last, widest, highest tick
|
||||
* labels where offset indicates the anchor point offset from the top in pixels.
|
||||
* @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}
|
||||
* @private
|
||||
*/
|
||||
private _computeLabelSizes;
|
||||
/**
|
||||
* Used to get the label to display in the tooltip for the given value
|
||||
* @param {*} value
|
||||
* @return {string}
|
||||
*/
|
||||
getLabelForValue(value: any): string;
|
||||
/**
|
||||
* Returns the location of the given data point. Value can either be an index or a numerical value
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
* @param {*} value
|
||||
* @param {number} [index]
|
||||
* @return {number}
|
||||
*/
|
||||
getPixelForValue(value: any, index?: number): number;
|
||||
/**
|
||||
* Used to get the data value from a given pixel. This is the inverse of getPixelForValue
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
* @param {number} pixel
|
||||
* @return {*}
|
||||
*/
|
||||
getValueForPixel(pixel: number): any;
|
||||
/**
|
||||
* Returns the location of the tick at the given index
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
* @param {number} index
|
||||
* @return {number}
|
||||
*/
|
||||
getPixelForTick(index: number): number;
|
||||
/**
|
||||
* Utility for getting the pixel location of a percentage of scale
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
* @param {number} decimal
|
||||
* @return {number}
|
||||
*/
|
||||
getPixelForDecimal(decimal: number): number;
|
||||
/**
|
||||
* @param {number} pixel
|
||||
* @return {number}
|
||||
*/
|
||||
getDecimalForPixel(pixel: number): number;
|
||||
/**
|
||||
* Returns the pixel for the minimum chart value
|
||||
* The coordinate (0, 0) is at the upper-left corner of the canvas
|
||||
* @return {number}
|
||||
*/
|
||||
getBasePixel(): number;
|
||||
/**
|
||||
* @return {number}
|
||||
*/
|
||||
getBaseValue(): number;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected getContext(index: any): any;
|
||||
/**
|
||||
* @return {number}
|
||||
* @private
|
||||
*/
|
||||
private _tickSize;
|
||||
/**
|
||||
* @return {boolean}
|
||||
* @private
|
||||
*/
|
||||
private _isVisible;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _computeGridLineItems;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _computeLabelItems;
|
||||
_getXAxisLabelAlignment(): string;
|
||||
_getYAxisLabelAlignment(tl: any): {
|
||||
textAlign: string;
|
||||
x: any;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
private _computeLabelArea;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected drawBackground(): void;
|
||||
getLineWidthForValue(value: any): any;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected drawGrid(chartArea: any): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected drawBorder(): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected drawLabels(chartArea: any): void;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected drawTitle(): void;
|
||||
draw(chartArea: any): void;
|
||||
/**
|
||||
* @return {object[]}
|
||||
* @private
|
||||
*/
|
||||
private _layers;
|
||||
/**
|
||||
* Returns visible dataset metas that are attached to this scale
|
||||
* @param {string} [type] - if specified, also filter by dataset type
|
||||
* @return {object[]}
|
||||
*/
|
||||
getMatchingVisibleMetas(type?: string): object[];
|
||||
/**
|
||||
* @param {number} index
|
||||
* @return {object}
|
||||
* @protected
|
||||
*/
|
||||
protected _resolveTickFontOptions(index: number): object;
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
protected _maxDigits(): number;
|
||||
}
|
||||
export type Chart = import('../types/index.js').Chart;
|
||||
export type Tick = {
|
||||
value: number | string;
|
||||
label?: string;
|
||||
major?: boolean;
|
||||
$context?: any;
|
||||
};
|
||||
import Element from "./core.element.js";
|
||||
@ -1 +0,0 @@
|
||||
export function applyScaleDefaults(defaults: any): void;
|
||||
31
staticfiles/chart.js/dist/core/core.ticks.d.ts
vendored
31
staticfiles/chart.js/dist/core/core.ticks.d.ts
vendored
@ -1,31 +0,0 @@
|
||||
declare namespace _default {
|
||||
export { formatters };
|
||||
}
|
||||
export default _default;
|
||||
declare namespace formatters {
|
||||
/**
|
||||
* Formatter for value labels
|
||||
* @method Chart.Ticks.formatters.values
|
||||
* @param value the value to display
|
||||
* @return {string|string[]} the label to display
|
||||
*/
|
||||
function values(value: any): string | string[];
|
||||
/**
|
||||
* Formatter for numeric ticks
|
||||
* @method Chart.Ticks.formatters.numeric
|
||||
* @param tickValue {number} the value to be formatted
|
||||
* @param index {number} the position of the tickValue parameter in the ticks array
|
||||
* @param ticks {object[]} the list of ticks being converted
|
||||
* @return {string} string representation of the tickValue parameter
|
||||
*/
|
||||
function numeric(tickValue: number, index: number, ticks: any[]): string;
|
||||
/**
|
||||
* Formatter for logarithmic ticks
|
||||
* @method Chart.Ticks.formatters.logarithmic
|
||||
* @param tickValue {number} the value to be formatted
|
||||
* @param index {number} the position of the tickValue parameter in the ticks array
|
||||
* @param ticks {object[]} the list of ticks being converted
|
||||
* @return {string} string representation of the tickValue parameter
|
||||
*/
|
||||
function logarithmic(tickValue: number, index: number, ticks: any[]): string;
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
/**
|
||||
* @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent
|
||||
*/
|
||||
export default class TypedRegistry {
|
||||
constructor(type: any, scope: any, override: any);
|
||||
type: any;
|
||||
scope: any;
|
||||
override: any;
|
||||
items: any;
|
||||
isForType(type: any): boolean;
|
||||
/**
|
||||
* @param {IChartComponent} item
|
||||
* @returns {string} The scope where items defaults were registered to.
|
||||
*/
|
||||
register(item: IChartComponent): string;
|
||||
/**
|
||||
* @param {string} id
|
||||
* @returns {object?}
|
||||
*/
|
||||
get(id: string): object | null;
|
||||
/**
|
||||
* @param {IChartComponent} item
|
||||
*/
|
||||
unregister(item: IChartComponent): void;
|
||||
}
|
||||
export type IChartComponent = {
|
||||
id: string;
|
||||
defaults: any;
|
||||
overrides?: any;
|
||||
defaultRoutes: any;
|
||||
};
|
||||
import defaults from "./core.defaults.js";
|
||||
import { overrides } from "./core.defaults.js";
|
||||
15
staticfiles/chart.js/dist/core/index.d.ts
vendored
15
staticfiles/chart.js/dist/core/index.d.ts
vendored
@ -1,15 +0,0 @@
|
||||
export type { DateAdapter, TimeUnit } from './core.adapters.js';
|
||||
export { default as _adapters } from './core.adapters.js';
|
||||
export { default as Animation } from './core.animation.js';
|
||||
export { default as Animations } from './core.animations.js';
|
||||
export { default as animator } from './core.animator.js';
|
||||
export { default as Chart } from './core.controller.js';
|
||||
export { default as DatasetController } from './core.datasetController.js';
|
||||
export { default as defaults } from './core.defaults.js';
|
||||
export { default as Element } from './core.element.js';
|
||||
export { default as Interaction } from './core.interaction.js';
|
||||
export { default as layouts } from './core.layouts.js';
|
||||
export { default as plugins } from './core.plugins.js';
|
||||
export { default as registry } from './core.registry.js';
|
||||
export { default as Scale } from './core.scale.js';
|
||||
export { default as Ticks } from './core.ticks.js';
|
||||
@ -1,51 +0,0 @@
|
||||
import Element from '../core/core.element.js';
|
||||
import type { ArcOptions, Point } from '../types/index.js';
|
||||
export interface ArcProps extends Point {
|
||||
startAngle: number;
|
||||
endAngle: number;
|
||||
innerRadius: number;
|
||||
outerRadius: number;
|
||||
circumference: number;
|
||||
}
|
||||
export default class ArcElement extends Element<ArcProps, ArcOptions> {
|
||||
static id: string;
|
||||
static defaults: {
|
||||
borderAlign: string;
|
||||
borderColor: string;
|
||||
borderDash: any[];
|
||||
borderDashOffset: number;
|
||||
borderJoinStyle: any;
|
||||
borderRadius: number;
|
||||
borderWidth: number;
|
||||
offset: number;
|
||||
spacing: number;
|
||||
angle: any;
|
||||
circular: boolean;
|
||||
selfJoin: boolean;
|
||||
};
|
||||
static defaultRoutes: {
|
||||
backgroundColor: string;
|
||||
};
|
||||
static descriptors: {
|
||||
_scriptable: boolean;
|
||||
_indexable: (name: any) => boolean;
|
||||
};
|
||||
circumference: number;
|
||||
endAngle: number;
|
||||
fullCircles: number;
|
||||
innerRadius: number;
|
||||
outerRadius: number;
|
||||
pixelMargin: number;
|
||||
startAngle: number;
|
||||
constructor(cfg: any);
|
||||
inRange(chartX: number, chartY: number, useFinalPosition: boolean): boolean;
|
||||
getCenterPoint(useFinalPosition: boolean): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
tooltipPosition(useFinalPosition: boolean): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
draw(ctx: CanvasRenderingContext2D): void;
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
export default class BarElement extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static defaults: any;
|
||||
constructor(cfg: any);
|
||||
options: any;
|
||||
horizontal: any;
|
||||
base: any;
|
||||
width: any;
|
||||
height: any;
|
||||
inflateAmount: any;
|
||||
draw(ctx: any): void;
|
||||
inRange(mouseX: any, mouseY: any, useFinalPosition: any): boolean;
|
||||
inXRange(mouseX: any, useFinalPosition: any): boolean;
|
||||
inYRange(mouseY: any, useFinalPosition: any): boolean;
|
||||
getCenterPoint(useFinalPosition: any): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
getRange(axis: any): number;
|
||||
}
|
||||
export type BarProps = {
|
||||
x: number;
|
||||
y: number;
|
||||
base: number;
|
||||
horizontal: boolean;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
import Element from "../core/core.element.js";
|
||||
@ -1,87 +0,0 @@
|
||||
export default class LineElement extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> {
|
||||
static id: string;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static defaults: any;
|
||||
static descriptors: {
|
||||
_scriptable: boolean;
|
||||
_indexable: (name: any) => boolean;
|
||||
};
|
||||
constructor(cfg: any);
|
||||
animated: boolean;
|
||||
options: any;
|
||||
_chart: any;
|
||||
_loop: any;
|
||||
_fullLoop: any;
|
||||
_path: any;
|
||||
_points: any;
|
||||
_segments: import("../helpers/helpers.segment.js").Segment[];
|
||||
_decimated: boolean;
|
||||
_pointsUpdated: boolean;
|
||||
_datasetIndex: any;
|
||||
updateControlPoints(chartArea: any, indexAxis: any): void;
|
||||
set points(arg: any);
|
||||
get points(): any;
|
||||
get segments(): import("../helpers/helpers.segment.js").Segment[];
|
||||
/**
|
||||
* First non-skipped point on this line
|
||||
* @returns {PointElement|undefined}
|
||||
*/
|
||||
first(): PointElement | undefined;
|
||||
/**
|
||||
* Last non-skipped point on this line
|
||||
* @returns {PointElement|undefined}
|
||||
*/
|
||||
last(): PointElement | undefined;
|
||||
/**
|
||||
* Interpolate a point in this line at the same value on `property` as
|
||||
* the reference `point` provided
|
||||
* @param {PointElement} point - the reference point
|
||||
* @param {string} property - the property to match on
|
||||
* @returns {PointElement|undefined}
|
||||
*/
|
||||
interpolate(point: PointElement, property: string): PointElement | undefined;
|
||||
/**
|
||||
* Append a segment of this line to current path.
|
||||
* @param {CanvasRenderingContext2D} ctx
|
||||
* @param {object} segment
|
||||
* @param {number} segment.start - start index of the segment, referring the points array
|
||||
* @param {number} segment.end - end index of the segment, referring the points array
|
||||
* @param {boolean} segment.loop - indicates that the segment is a loop
|
||||
* @param {object} params
|
||||
* @param {boolean} params.move - move to starting point (vs line to it)
|
||||
* @param {boolean} params.reverse - path the segment from end to start
|
||||
* @param {number} params.start - limit segment to points starting from `start` index
|
||||
* @param {number} params.end - limit segment to points ending at `start` + `count` index
|
||||
* @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)
|
||||
*/
|
||||
pathSegment(ctx: CanvasRenderingContext2D, segment: {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
}, params: {
|
||||
move: boolean;
|
||||
reverse: boolean;
|
||||
start: number;
|
||||
end: number;
|
||||
}): undefined | boolean;
|
||||
/**
|
||||
* Append all segments of this line to current path.
|
||||
* @param {CanvasRenderingContext2D|Path2D} ctx
|
||||
* @param {number} [start]
|
||||
* @param {number} [count]
|
||||
* @returns {undefined|boolean} - true if line is a full loop (path should be closed)
|
||||
*/
|
||||
path(ctx: CanvasRenderingContext2D | Path2D, start?: number, count?: number): undefined | boolean;
|
||||
/**
|
||||
* Draw
|
||||
* @param {CanvasRenderingContext2D} ctx
|
||||
* @param {object} chartArea
|
||||
* @param {number} [start]
|
||||
* @param {number} [count]
|
||||
*/
|
||||
draw(ctx: CanvasRenderingContext2D, chartArea: object, start?: number, count?: number): void;
|
||||
}
|
||||
export type PointElement = import('./element.point.js').default;
|
||||
import Element from "../core/core.element.js";
|
||||
@ -1,39 +0,0 @@
|
||||
import Element from '../core/core.element.js';
|
||||
import type { CartesianParsedData, ChartArea, Point, PointHoverOptions, PointOptions } from '../types/index.js';
|
||||
export type PointProps = Point;
|
||||
export default class PointElement extends Element<PointProps, PointOptions & PointHoverOptions> {
|
||||
static id: string;
|
||||
parsed: CartesianParsedData;
|
||||
skip?: boolean;
|
||||
stop?: boolean;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static defaults: {
|
||||
borderWidth: number;
|
||||
hitRadius: number;
|
||||
hoverBorderWidth: number;
|
||||
hoverRadius: number;
|
||||
pointStyle: string;
|
||||
radius: number;
|
||||
rotation: number;
|
||||
};
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
static defaultRoutes: {
|
||||
backgroundColor: string;
|
||||
borderColor: string;
|
||||
};
|
||||
constructor(cfg: any);
|
||||
inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean): boolean;
|
||||
inXRange(mouseX: number, useFinalPosition?: boolean): boolean;
|
||||
inYRange(mouseY: number, useFinalPosition?: boolean): boolean;
|
||||
getCenterPoint(useFinalPosition?: boolean): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
size(options?: Partial<PointOptions & PointHoverOptions>): number;
|
||||
draw(ctx: CanvasRenderingContext2D, area: ChartArea): void;
|
||||
getRange(): any;
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
export { default as ArcElement } from "./element.arc.js";
|
||||
export { default as LineElement } from "./element.line.js";
|
||||
export { default as PointElement } from "./element.point.js";
|
||||
export { default as BarElement } from "./element.bar.js";
|
||||
136
staticfiles/chart.js/dist/helpers.cjs
vendored
136
staticfiles/chart.js/dist/helpers.cjs
vendored
@ -1,136 +0,0 @@
|
||||
/*!
|
||||
* Chart.js v4.5.1
|
||||
* https://www.chartjs.org
|
||||
* (c) 2025 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var helpers_dataset = require('./chunks/helpers.dataset.cjs');
|
||||
require('@kurkle/color');
|
||||
|
||||
|
||||
|
||||
exports.HALF_PI = helpers_dataset.HALF_PI;
|
||||
exports.INFINITY = helpers_dataset.INFINITY;
|
||||
exports.PI = helpers_dataset.PI;
|
||||
exports.PITAU = helpers_dataset.PITAU;
|
||||
exports.QUARTER_PI = helpers_dataset.QUARTER_PI;
|
||||
exports.RAD_PER_DEG = helpers_dataset.RAD_PER_DEG;
|
||||
exports.TAU = helpers_dataset.TAU;
|
||||
exports.TWO_THIRDS_PI = helpers_dataset.TWO_THIRDS_PI;
|
||||
exports._addGrace = helpers_dataset._addGrace;
|
||||
exports._alignPixel = helpers_dataset._alignPixel;
|
||||
exports._alignStartEnd = helpers_dataset._alignStartEnd;
|
||||
exports._angleBetween = helpers_dataset._angleBetween;
|
||||
exports._angleDiff = helpers_dataset._angleDiff;
|
||||
exports._arrayUnique = helpers_dataset._arrayUnique;
|
||||
exports._attachContext = helpers_dataset._attachContext;
|
||||
exports._bezierCurveTo = helpers_dataset._bezierCurveTo;
|
||||
exports._bezierInterpolation = helpers_dataset._bezierInterpolation;
|
||||
exports._boundSegment = helpers_dataset._boundSegment;
|
||||
exports._boundSegments = helpers_dataset._boundSegments;
|
||||
exports._capitalize = helpers_dataset._capitalize;
|
||||
exports._computeSegments = helpers_dataset._computeSegments;
|
||||
exports._createResolver = helpers_dataset._createResolver;
|
||||
exports._decimalPlaces = helpers_dataset._decimalPlaces;
|
||||
exports._deprecated = helpers_dataset._deprecated;
|
||||
exports._descriptors = helpers_dataset._descriptors;
|
||||
exports._elementsEqual = helpers_dataset._elementsEqual;
|
||||
exports._factorize = helpers_dataset._factorize;
|
||||
exports._filterBetween = helpers_dataset._filterBetween;
|
||||
exports._getParentNode = helpers_dataset._getParentNode;
|
||||
exports._getStartAndCountOfVisiblePoints = helpers_dataset._getStartAndCountOfVisiblePoints;
|
||||
exports._int16Range = helpers_dataset._int16Range;
|
||||
exports._isBetween = helpers_dataset._isBetween;
|
||||
exports._isClickEvent = helpers_dataset._isClickEvent;
|
||||
exports._isDomSupported = helpers_dataset._isDomSupported;
|
||||
exports._isPointInArea = helpers_dataset._isPointInArea;
|
||||
exports._limitValue = helpers_dataset._limitValue;
|
||||
exports._longestText = helpers_dataset._longestText;
|
||||
exports._lookup = helpers_dataset._lookup;
|
||||
exports._lookupByKey = helpers_dataset._lookupByKey;
|
||||
exports._measureText = helpers_dataset._measureText;
|
||||
exports._merger = helpers_dataset._merger;
|
||||
exports._mergerIf = helpers_dataset._mergerIf;
|
||||
exports._normalizeAngle = helpers_dataset._normalizeAngle;
|
||||
exports._parseObjectDataRadialScale = helpers_dataset._parseObjectDataRadialScale;
|
||||
exports._pointInLine = helpers_dataset._pointInLine;
|
||||
exports._readValueToProps = helpers_dataset._readValueToProps;
|
||||
exports._rlookupByKey = helpers_dataset._rlookupByKey;
|
||||
exports._scaleRangesChanged = helpers_dataset._scaleRangesChanged;
|
||||
exports._setMinAndMaxByKey = helpers_dataset._setMinAndMaxByKey;
|
||||
exports._splitKey = helpers_dataset._splitKey;
|
||||
exports._steppedInterpolation = helpers_dataset._steppedInterpolation;
|
||||
exports._steppedLineTo = helpers_dataset._steppedLineTo;
|
||||
exports._textX = helpers_dataset._textX;
|
||||
exports._toLeftRightCenter = helpers_dataset._toLeftRightCenter;
|
||||
exports._updateBezierControlPoints = helpers_dataset._updateBezierControlPoints;
|
||||
exports.addRoundedRectPath = helpers_dataset.addRoundedRectPath;
|
||||
exports.almostEquals = helpers_dataset.almostEquals;
|
||||
exports.almostWhole = helpers_dataset.almostWhole;
|
||||
exports.callback = helpers_dataset.callback;
|
||||
exports.clearCanvas = helpers_dataset.clearCanvas;
|
||||
exports.clipArea = helpers_dataset.clipArea;
|
||||
exports.clone = helpers_dataset.clone;
|
||||
exports.color = helpers_dataset.color;
|
||||
exports.createContext = helpers_dataset.createContext;
|
||||
exports.debounce = helpers_dataset.debounce;
|
||||
exports.defined = helpers_dataset.defined;
|
||||
exports.distanceBetweenPoints = helpers_dataset.distanceBetweenPoints;
|
||||
exports.drawPoint = helpers_dataset.drawPoint;
|
||||
exports.drawPointLegend = helpers_dataset.drawPointLegend;
|
||||
exports.each = helpers_dataset.each;
|
||||
exports.easingEffects = helpers_dataset.effects;
|
||||
exports.finiteOrDefault = helpers_dataset.finiteOrDefault;
|
||||
exports.fontString = helpers_dataset.fontString;
|
||||
exports.formatNumber = helpers_dataset.formatNumber;
|
||||
exports.getAngleFromPoint = helpers_dataset.getAngleFromPoint;
|
||||
exports.getDatasetClipArea = helpers_dataset.getDatasetClipArea;
|
||||
exports.getHoverColor = helpers_dataset.getHoverColor;
|
||||
exports.getMaximumSize = helpers_dataset.getMaximumSize;
|
||||
exports.getRelativePosition = helpers_dataset.getRelativePosition;
|
||||
exports.getRtlAdapter = helpers_dataset.getRtlAdapter;
|
||||
exports.getStyle = helpers_dataset.getStyle;
|
||||
exports.isArray = helpers_dataset.isArray;
|
||||
exports.isFinite = helpers_dataset.isNumberFinite;
|
||||
exports.isFunction = helpers_dataset.isFunction;
|
||||
exports.isNullOrUndef = helpers_dataset.isNullOrUndef;
|
||||
exports.isNumber = helpers_dataset.isNumber;
|
||||
exports.isObject = helpers_dataset.isObject;
|
||||
exports.isPatternOrGradient = helpers_dataset.isPatternOrGradient;
|
||||
exports.listenArrayEvents = helpers_dataset.listenArrayEvents;
|
||||
exports.log10 = helpers_dataset.log10;
|
||||
exports.merge = helpers_dataset.merge;
|
||||
exports.mergeIf = helpers_dataset.mergeIf;
|
||||
exports.niceNum = helpers_dataset.niceNum;
|
||||
exports.noop = helpers_dataset.noop;
|
||||
exports.overrideTextDirection = helpers_dataset.overrideTextDirection;
|
||||
exports.readUsedSize = helpers_dataset.readUsedSize;
|
||||
exports.renderText = helpers_dataset.renderText;
|
||||
exports.requestAnimFrame = helpers_dataset.requestAnimFrame;
|
||||
exports.resolve = helpers_dataset.resolve;
|
||||
exports.resolveObjectKey = helpers_dataset.resolveObjectKey;
|
||||
exports.restoreTextDirection = helpers_dataset.restoreTextDirection;
|
||||
exports.retinaScale = helpers_dataset.retinaScale;
|
||||
exports.setsEqual = helpers_dataset.setsEqual;
|
||||
exports.sign = helpers_dataset.sign;
|
||||
exports.splineCurve = helpers_dataset.splineCurve;
|
||||
exports.splineCurveMonotone = helpers_dataset.splineCurveMonotone;
|
||||
exports.supportsEventListenerOptions = helpers_dataset.supportsEventListenerOptions;
|
||||
exports.throttled = helpers_dataset.throttled;
|
||||
exports.toDegrees = helpers_dataset.toDegrees;
|
||||
exports.toDimension = helpers_dataset.toDimension;
|
||||
exports.toFont = helpers_dataset.toFont;
|
||||
exports.toFontString = helpers_dataset.toFontString;
|
||||
exports.toLineHeight = helpers_dataset.toLineHeight;
|
||||
exports.toPadding = helpers_dataset.toPadding;
|
||||
exports.toPercentage = helpers_dataset.toPercentage;
|
||||
exports.toRadians = helpers_dataset.toRadians;
|
||||
exports.toTRBL = helpers_dataset.toTRBL;
|
||||
exports.toTRBLCorners = helpers_dataset.toTRBLCorners;
|
||||
exports.uid = helpers_dataset.uid;
|
||||
exports.unclipArea = helpers_dataset.unclipArea;
|
||||
exports.unlistenArrayEvents = helpers_dataset.unlistenArrayEvents;
|
||||
exports.valueOrDefault = helpers_dataset.valueOrDefault;
|
||||
//# sourceMappingURL=helpers.cjs.map
|
||||
1
staticfiles/chart.js/dist/helpers.cjs.map
vendored
1
staticfiles/chart.js/dist/helpers.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"helpers.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
9
staticfiles/chart.js/dist/helpers.js
vendored
9
staticfiles/chart.js/dist/helpers.js
vendored
@ -1,9 +0,0 @@
|
||||
/*!
|
||||
* Chart.js v4.5.1
|
||||
* https://www.chartjs.org
|
||||
* (c) 2025 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
export { H as HALF_PI, b3 as INFINITY, P as PI, b2 as PITAU, b5 as QUARTER_PI, b4 as RAD_PER_DEG, T as TAU, b6 as TWO_THIRDS_PI, R as _addGrace, X as _alignPixel, a2 as _alignStartEnd, p as _angleBetween, b7 as _angleDiff, _ as _arrayUnique, a8 as _attachContext, au as _bezierCurveTo, ar as _bezierInterpolation, az as _boundSegment, ap as _boundSegments, a5 as _capitalize, ao as _computeSegments, a9 as _createResolver, aL as _decimalPlaces, aW as _deprecated, aa as _descriptors, ai as _elementsEqual, N as _factorize, aP as _filterBetween, I as _getParentNode, q as _getStartAndCountOfVisiblePoints, W as _int16Range, ak as _isBetween, aj as _isClickEvent, M as _isDomSupported, C as _isPointInArea, S as _limitValue, aO as _longestText, aQ as _lookup, B as _lookupByKey, V as _measureText, aU as _merger, aV as _mergerIf, al as _normalizeAngle, y as _parseObjectDataRadialScale, as as _pointInLine, am as _readValueToProps, A as _rlookupByKey, w as _scaleRangesChanged, aH as _setMinAndMaxByKey, aX as _splitKey, aq as _steppedInterpolation, at as _steppedLineTo, aC as _textX, a1 as _toLeftRightCenter, an as _updateBezierControlPoints, aw as addRoundedRectPath, aK as almostEquals, aJ as almostWhole, Q as callback, af as clearCanvas, Y as clipArea, aT as clone, c as color, j as createContext, ad as debounce, h as defined, aF as distanceBetweenPoints, av as drawPoint, aE as drawPointLegend, F as each, e as easingEffects, O as finiteOrDefault, b0 as fontString, o as formatNumber, D as getAngleFromPoint, ah as getDatasetClipArea, aS as getHoverColor, G as getMaximumSize, z as getRelativePosition, aA as getRtlAdapter, a$ as getStyle, b as isArray, g as isFinite, a7 as isFunction, k as isNullOrUndef, x as isNumber, i as isObject, aR as isPatternOrGradient, l as listenArrayEvents, aN as log10, a4 as merge, ab as mergeIf, aI as niceNum, aG as noop, aB as overrideTextDirection, J as readUsedSize, Z as renderText, r as requestAnimFrame, a as resolve, f as resolveObjectKey, aD as restoreTextDirection, ae as retinaScale, ag as setsEqual, s as sign, aZ as splineCurve, a_ as splineCurveMonotone, K as supportsEventListenerOptions, L as throttled, U as toDegrees, n as toDimension, a0 as toFont, aY as toFontString, b1 as toLineHeight, E as toPadding, m as toPercentage, t as toRadians, ax as toTRBL, ay as toTRBLCorners, ac as uid, $ as unclipArea, u as unlistenArrayEvents, v as valueOrDefault } from './chunks/helpers.dataset.js';
|
||||
import '@kurkle/color';
|
||||
//# sourceMappingURL=helpers.js.map
|
||||
1
staticfiles/chart.js/dist/helpers.js.map
vendored
1
staticfiles/chart.js/dist/helpers.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
||||
@ -1,75 +0,0 @@
|
||||
import type { Chart, Point, FontSpec, CanvasFontSpec, PointStyle, RenderTextOpts } from '../types/index.js';
|
||||
import type { TRBL, SplinePoint, RoundedRect, TRBLCorners } from '../types/geometric.js';
|
||||
/**
|
||||
* Converts the given font object into a CSS font string.
|
||||
* @param font - A font object.
|
||||
* @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font
|
||||
* @private
|
||||
*/
|
||||
export declare function toFontString(font: FontSpec): string;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _measureText(ctx: CanvasRenderingContext2D, data: Record<string, number>, gc: string[], longest: number, string: string): number;
|
||||
type Thing = string | undefined | null;
|
||||
type Things = (Thing | Thing[])[];
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _longestText(ctx: CanvasRenderingContext2D, font: string, arrayOfThings: Things, cache?: {
|
||||
data?: Record<string, number>;
|
||||
garbageCollect?: string[];
|
||||
font?: string;
|
||||
}): number;
|
||||
/**
|
||||
* Returns the aligned pixel value to avoid anti-aliasing blur
|
||||
* @param chart - The chart instance.
|
||||
* @param pixel - A pixel value.
|
||||
* @param width - The width of the element.
|
||||
* @returns The aligned pixel value.
|
||||
* @private
|
||||
*/
|
||||
export declare function _alignPixel(chart: Chart, pixel: number, width: number): number;
|
||||
/**
|
||||
* Clears the entire canvas.
|
||||
*/
|
||||
export declare function clearCanvas(canvas?: HTMLCanvasElement, ctx?: CanvasRenderingContext2D): void;
|
||||
export interface DrawPointOptions {
|
||||
pointStyle: PointStyle;
|
||||
rotation?: number;
|
||||
radius: number;
|
||||
borderWidth: number;
|
||||
}
|
||||
export declare function drawPoint(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number): void;
|
||||
export declare function drawPointLegend(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number, w: number): void;
|
||||
/**
|
||||
* Returns true if the point is inside the rectangle
|
||||
* @param point - The point to test
|
||||
* @param area - The rectangle
|
||||
* @param margin - allowed margin
|
||||
* @private
|
||||
*/
|
||||
export declare function _isPointInArea(point: Point, area: TRBL, margin?: number): boolean;
|
||||
export declare function clipArea(ctx: CanvasRenderingContext2D, area: TRBL): void;
|
||||
export declare function unclipArea(ctx: CanvasRenderingContext2D): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _steppedLineTo(ctx: CanvasRenderingContext2D, previous: Point, target: Point, flip?: boolean, mode?: string): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _bezierCurveTo(ctx: CanvasRenderingContext2D, previous: SplinePoint, target: SplinePoint, flip?: boolean): void;
|
||||
/**
|
||||
* Render text onto the canvas
|
||||
*/
|
||||
export declare function renderText(ctx: CanvasRenderingContext2D, text: string | string[], x: number, y: number, font: CanvasFontSpec, opts?: RenderTextOpts): void;
|
||||
/**
|
||||
* Add a path of a rectangle with rounded corners to the current sub-path
|
||||
* @param ctx - Context
|
||||
* @param rect - Bounding rect
|
||||
*/
|
||||
export declare function addRoundedRectPath(ctx: CanvasRenderingContext2D, rect: RoundedRect & {
|
||||
radius: TRBLCorners;
|
||||
}): void;
|
||||
export {};
|
||||
@ -1,68 +0,0 @@
|
||||
/**
|
||||
* Binary search
|
||||
* @param table - the table search. must be sorted!
|
||||
* @param value - value to find
|
||||
* @param cmp
|
||||
* @private
|
||||
*/
|
||||
export declare function _lookup(table: number[], value: number, cmp?: (value: number) => boolean): {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
export declare function _lookup<T>(table: T[], value: number, cmp: (value: number) => boolean): {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
/**
|
||||
* Binary search
|
||||
* @param table - the table search. must be sorted!
|
||||
* @param key - property name for the value in each entry
|
||||
* @param value - value to find
|
||||
* @param last - lookup last index
|
||||
* @private
|
||||
*/
|
||||
export declare const _lookupByKey: (table: Record<string, number>[], key: string, value: number, last?: boolean) => {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
/**
|
||||
* Reverse binary search
|
||||
* @param table - the table search. must be sorted!
|
||||
* @param key - property name for the value in each entry
|
||||
* @param value - value to find
|
||||
* @private
|
||||
*/
|
||||
export declare const _rlookupByKey: (table: Record<string, number>[], key: string, value: number) => {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
/**
|
||||
* Return subset of `values` between `min` and `max` inclusive.
|
||||
* Values are assumed to be in sorted order.
|
||||
* @param values - sorted array of values
|
||||
* @param min - min value
|
||||
* @param max - max value
|
||||
*/
|
||||
export declare function _filterBetween(values: number[], min: number, max: number): number[];
|
||||
export interface ArrayListener<T> {
|
||||
_onDataPush?(...item: T[]): void;
|
||||
_onDataPop?(): void;
|
||||
_onDataShift?(): void;
|
||||
_onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;
|
||||
_onDataUnshift?(...item: T[]): void;
|
||||
}
|
||||
/**
|
||||
* Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',
|
||||
* 'unshift') and notify the listener AFTER the array has been altered. Listeners are
|
||||
* called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.
|
||||
*/
|
||||
export declare function listenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;
|
||||
/**
|
||||
* Removes the given array event listener and cleanup extra attached properties (such as
|
||||
* the _chartjs stub and overridden methods) if array doesn't have any more listeners.
|
||||
*/
|
||||
export declare function unlistenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;
|
||||
/**
|
||||
* @param items
|
||||
*/
|
||||
export declare function _arrayUnique<T>(items: T[]): T[];
|
||||
@ -1,13 +0,0 @@
|
||||
import { Color } from '@kurkle/color';
|
||||
export declare function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient;
|
||||
export declare function color(value: CanvasGradient): CanvasGradient;
|
||||
export declare function color(value: CanvasPattern): CanvasPattern;
|
||||
export declare function color(value: string | {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
a: number;
|
||||
} | [number, number, number] | [number, number, number, number]): Color;
|
||||
export declare function getHoverColor(value: CanvasGradient): CanvasGradient;
|
||||
export declare function getHoverColor(value: CanvasPattern): CanvasPattern;
|
||||
export declare function getHoverColor(value: string): string;
|
||||
@ -1,31 +0,0 @@
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { ChartMeta } from '../types/index.js';
|
||||
import type { ResolverObjectKey, ResolverCache, ResolverProxy, DescriptorDefaults, Descriptor, ContextProxy } from './helpers.config.types.js';
|
||||
export * from './helpers.config.types.js';
|
||||
/**
|
||||
* Creates a Proxy for resolving raw values for options.
|
||||
* @param scopes - The option scopes to look for values, in resolution order
|
||||
* @param prefixes - The prefixes for values, in resolution order.
|
||||
* @param rootScopes - The root option scopes
|
||||
* @param fallback - Parent scopes fallback
|
||||
* @param getTarget - callback for getting the target for changed values
|
||||
* @returns Proxy
|
||||
* @private
|
||||
*/
|
||||
export declare function _createResolver<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T>(scopes: T, prefixes?: string[], rootScopes?: R, fallback?: ResolverObjectKey, getTarget?: () => AnyObject): any;
|
||||
/**
|
||||
* Returns an Proxy for resolving option values with context.
|
||||
* @param proxy - The Proxy returned by `_createResolver`
|
||||
* @param context - Context object for scriptable/indexable options
|
||||
* @param subProxy - The proxy provided for scriptable options
|
||||
* @param descriptorDefaults - Defaults for descriptors
|
||||
* @private
|
||||
*/
|
||||
export declare function _attachContext<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T>(proxy: ResolverProxy<T, R>, context: AnyObject, subProxy?: ResolverProxy<T, R>, descriptorDefaults?: DescriptorDefaults): ContextProxy<T, R>;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _descriptors(proxy: ResolverCache, defaults?: DescriptorDefaults): Descriptor;
|
||||
export declare function _parseObjectDataRadialScale(meta: ChartMeta<'line' | 'scatter'>, data: AnyObject[], start: number, count: number): {
|
||||
r: unknown;
|
||||
}[];
|
||||
@ -1,41 +0,0 @@
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { Merge } from '../types/utils.js';
|
||||
export type ResolverObjectKey = string | boolean;
|
||||
export interface ResolverCache<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> {
|
||||
[Symbol.toStringTag]: 'Object';
|
||||
_cacheable: boolean;
|
||||
_scopes: T;
|
||||
_rootScopes: T | R;
|
||||
_fallback: ResolverObjectKey;
|
||||
_keys?: string[];
|
||||
_scriptable?: boolean;
|
||||
_indexable?: boolean;
|
||||
_allKeys?: boolean;
|
||||
_storage?: T[number];
|
||||
_getTarget(): T[number];
|
||||
override<S extends AnyObject>(scope: S): ResolverProxy<(T[number] | S)[], T | R>;
|
||||
}
|
||||
export type ResolverProxy<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> = Merge<T[number]> & ResolverCache<T, R>;
|
||||
export interface DescriptorDefaults {
|
||||
scriptable: boolean;
|
||||
indexable: boolean;
|
||||
allKeys?: boolean;
|
||||
}
|
||||
export interface Descriptor {
|
||||
allKeys: boolean;
|
||||
scriptable: boolean;
|
||||
indexable: boolean;
|
||||
isScriptable(key: string): boolean;
|
||||
isIndexable(key: string): boolean;
|
||||
}
|
||||
export interface ContextCache<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> {
|
||||
_cacheable: boolean;
|
||||
_proxy: ResolverProxy<T, R>;
|
||||
_context: AnyObject;
|
||||
_subProxy: ResolverProxy<T, R>;
|
||||
_stack: Set<string>;
|
||||
_descriptors: Descriptor;
|
||||
setContext(ctx: AnyObject): ContextProxy<T, R>;
|
||||
override<S extends AnyObject>(scope: S): ContextProxy<(T[number] | S)[], T | R>;
|
||||
}
|
||||
export type ContextProxy<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> = Merge<T[number]> & ContextCache<T, R>;
|
||||
147
staticfiles/chart.js/dist/helpers/helpers.core.d.ts
vendored
147
staticfiles/chart.js/dist/helpers/helpers.core.d.ts
vendored
@ -1,147 +0,0 @@
|
||||
/**
|
||||
* @namespace Chart.helpers
|
||||
*/
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { ActiveDataPoint, ChartEvent } from '../types/index.js';
|
||||
/**
|
||||
* An empty function that can be used, for example, for optional callback.
|
||||
*/
|
||||
export declare function noop(): void;
|
||||
/**
|
||||
* Returns a unique id, sequentially generated from a global variable.
|
||||
*/
|
||||
export declare const uid: () => number;
|
||||
/**
|
||||
* Returns true if `value` is neither null nor undefined, else returns false.
|
||||
* @param value - The value to test.
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function isNullOrUndef(value: unknown): value is null | undefined;
|
||||
/**
|
||||
* Returns true if `value` is an array (including typed arrays), else returns false.
|
||||
* @param value - The value to test.
|
||||
* @function
|
||||
*/
|
||||
export declare function isArray<T = unknown>(value: unknown): value is T[];
|
||||
/**
|
||||
* Returns true if `value` is an object (excluding null), else returns false.
|
||||
* @param value - The value to test.
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function isObject(value: unknown): value is AnyObject;
|
||||
/**
|
||||
* Returns true if `value` is a finite number, else returns false
|
||||
* @param value - The value to test.
|
||||
*/
|
||||
declare function isNumberFinite(value: unknown): value is number;
|
||||
export { isNumberFinite as isFinite, };
|
||||
/**
|
||||
* Returns `value` if finite, else returns `defaultValue`.
|
||||
* @param value - The value to return if defined.
|
||||
* @param defaultValue - The value to return if `value` is not finite.
|
||||
*/
|
||||
export declare function finiteOrDefault(value: unknown, defaultValue: number): number;
|
||||
/**
|
||||
* Returns `value` if defined, else returns `defaultValue`.
|
||||
* @param value - The value to return if defined.
|
||||
* @param defaultValue - The value to return if `value` is undefined.
|
||||
*/
|
||||
export declare function valueOrDefault<T>(value: T | undefined, defaultValue: T): T;
|
||||
export declare const toPercentage: (value: number | string, dimension: number) => number;
|
||||
export declare const toDimension: (value: number | string, dimension: number) => number;
|
||||
/**
|
||||
* Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the
|
||||
* value returned by `fn`. If `fn` is not a function, this method returns undefined.
|
||||
* @param fn - The function to call.
|
||||
* @param args - The arguments with which `fn` should be called.
|
||||
* @param [thisArg] - The value of `this` provided for the call to `fn`.
|
||||
*/
|
||||
export declare function callback<T extends (this: TA, ...restArgs: unknown[]) => R, TA, R>(fn: T | undefined, args: unknown[], thisArg?: TA): R | undefined;
|
||||
/**
|
||||
* Note(SB) for performance sake, this method should only be used when loopable type
|
||||
* is unknown or in none intensive code (not called often and small loopable). Else
|
||||
* it's preferable to use a regular for() loop and save extra function calls.
|
||||
* @param loopable - The object or array to be iterated.
|
||||
* @param fn - The function to call for each item.
|
||||
* @param [thisArg] - The value of `this` provided for the call to `fn`.
|
||||
* @param [reverse] - If true, iterates backward on the loopable.
|
||||
*/
|
||||
export declare function each<T, TA>(loopable: Record<string, T>, fn: (this: TA, v: T, i: string) => void, thisArg?: TA, reverse?: boolean): void;
|
||||
export declare function each<T, TA>(loopable: T[], fn: (this: TA, v: T, i: number) => void, thisArg?: TA, reverse?: boolean): void;
|
||||
/**
|
||||
* Returns true if the `a0` and `a1` arrays have the same content, else returns false.
|
||||
* @param a0 - The array to compare
|
||||
* @param a1 - The array to compare
|
||||
* @private
|
||||
*/
|
||||
export declare function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]): boolean;
|
||||
/**
|
||||
* Returns a deep copy of `source` without keeping references on objects and arrays.
|
||||
* @param source - The value to clone.
|
||||
*/
|
||||
export declare function clone<T>(source: T): T;
|
||||
/**
|
||||
* The default merger when Chart.helpers.merge is called without merger option.
|
||||
* Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.
|
||||
* @private
|
||||
*/
|
||||
export declare function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject): void;
|
||||
export interface MergeOptions {
|
||||
merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;
|
||||
}
|
||||
/**
|
||||
* Recursively deep copies `source` properties into `target` with the given `options`.
|
||||
* IMPORTANT: `target` is not cloned and will be updated with `source` properties.
|
||||
* @param target - The target object in which all sources are merged into.
|
||||
* @param source - Object(s) to merge into `target`.
|
||||
* @param [options] - Merging options:
|
||||
* @param [options.merger] - The merge method (key, target, source, options)
|
||||
* @returns The `target` object.
|
||||
*/
|
||||
export declare function merge<T>(target: T, source: [], options?: MergeOptions): T;
|
||||
export declare function merge<T, S1>(target: T, source: S1, options?: MergeOptions): T & S1;
|
||||
export declare function merge<T, S1>(target: T, source: [S1], options?: MergeOptions): T & S1;
|
||||
export declare function merge<T, S1, S2>(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;
|
||||
export declare function merge<T, S1, S2, S3>(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;
|
||||
export declare function merge<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4], options?: MergeOptions): T & S1 & S2 & S3 & S4;
|
||||
export declare function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;
|
||||
/**
|
||||
* Recursively deep copies `source` properties into `target` *only* if not defined in target.
|
||||
* IMPORTANT: `target` is not cloned and will be updated with `source` properties.
|
||||
* @param target - The target object in which all sources are merged into.
|
||||
* @param source - Object(s) to merge into `target`.
|
||||
* @returns The `target` object.
|
||||
*/
|
||||
export declare function mergeIf<T>(target: T, source: []): T;
|
||||
export declare function mergeIf<T, S1>(target: T, source: S1): T & S1;
|
||||
export declare function mergeIf<T, S1>(target: T, source: [S1]): T & S1;
|
||||
export declare function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2;
|
||||
export declare function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;
|
||||
export declare function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;
|
||||
export declare function mergeIf<T>(target: T, source: AnyObject[]): AnyObject;
|
||||
/**
|
||||
* Merges source[key] in target[key] only if target[key] is undefined.
|
||||
* @private
|
||||
*/
|
||||
export declare function _mergerIf(key: string, target: AnyObject, source: AnyObject): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _deprecated(scope: string, value: unknown, previous: string, current: string): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _splitKey(key: string): string[];
|
||||
export declare function resolveObjectKey(obj: AnyObject, key: string): any;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _capitalize(str: string): string;
|
||||
export declare const defined: (value: unknown) => boolean;
|
||||
export declare const isFunction: (value: unknown) => value is (...args: any[]) => any;
|
||||
export declare const setsEqual: <T>(a: Set<T>, b: Set<T>) => boolean;
|
||||
/**
|
||||
* @param e - The event
|
||||
* @private
|
||||
*/
|
||||
export declare function _isClickEvent(e: ChartEvent): boolean;
|
||||
@ -1,17 +0,0 @@
|
||||
import type { ChartArea } from '../types/index.js';
|
||||
import type { SplinePoint } from '../types/geometric.js';
|
||||
export declare function splineCurve(firstPoint: SplinePoint, middlePoint: SplinePoint, afterPoint: SplinePoint, t: number): {
|
||||
previous: SplinePoint;
|
||||
next: SplinePoint;
|
||||
};
|
||||
/**
|
||||
* This function calculates Bézier control points in a similar way than |splineCurve|,
|
||||
* but preserves monotonicity of the provided data and ensures no local extremums are added
|
||||
* between the dataset discrete points due to the interpolation.
|
||||
* See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
|
||||
*/
|
||||
export declare function splineCurveMonotone(points: SplinePoint[], indexAxis?: 'x' | 'y'): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _updateBezierControlPoints(points: SplinePoint[], options: any, area: ChartArea, loop: boolean, indexAxis: 'x' | 'y'): void;
|
||||
@ -1,2 +0,0 @@
|
||||
import type { Chart, ChartMeta, TRBL } from '../types/index.js';
|
||||
export declare function getDatasetClipArea(chart: Chart, meta: ChartMeta): TRBL | false;
|
||||
@ -1,48 +0,0 @@
|
||||
import type PrivateChart from '../core/core.controller.js';
|
||||
import type { Chart, ChartEvent } from '../types.js';
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _isDomSupported(): boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement;
|
||||
export declare function getStyle(el: HTMLElement, property: string): string;
|
||||
/**
|
||||
* Gets an event's x, y coordinates, relative to the chart area
|
||||
* @param event
|
||||
* @param chart
|
||||
* @returns x and y coordinates of the event
|
||||
*/
|
||||
export declare function getRelativePosition(event: Event | ChartEvent | TouchEvent | MouseEvent, chart: Chart | PrivateChart): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export declare function getMaximumSize(canvas: HTMLCanvasElement, bbWidth?: number, bbHeight?: number, aspectRatio?: number): {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
/**
|
||||
* @param chart
|
||||
* @param forceRatio
|
||||
* @param forceStyle
|
||||
* @returns True if the canvas context size or transformation has changed.
|
||||
*/
|
||||
export declare function retinaScale(chart: Chart | PrivateChart, forceRatio: number, forceStyle?: boolean): boolean | void;
|
||||
/**
|
||||
* Detects support for options object argument in addEventListener.
|
||||
* https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
|
||||
* @private
|
||||
*/
|
||||
export declare const supportsEventListenerOptions: boolean;
|
||||
/**
|
||||
* The "used" size is the final value of a dimension property after all calculations have
|
||||
* been performed. This method uses the computed style of `element` but returns undefined
|
||||
* if the computed style is not expressed in pixels. That can happen in some cases where
|
||||
* `element` has a size relative to its parent and this last one is not yet displayed,
|
||||
* for example because of `display: none` on a parent node.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value
|
||||
* @returns Size in pixels or undefined if unknown.
|
||||
*/
|
||||
export declare function readUsedSize(element: HTMLElement, property: 'width' | 'height'): number | undefined;
|
||||
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Easing functions adapted from Robert Penner's easing equations.
|
||||
* @namespace Chart.helpers.easing.effects
|
||||
* @see http://www.robertpenner.com/easing/
|
||||
*/
|
||||
declare const effects: {
|
||||
readonly linear: (t: number) => number;
|
||||
readonly easeInQuad: (t: number) => number;
|
||||
readonly easeOutQuad: (t: number) => number;
|
||||
readonly easeInOutQuad: (t: number) => number;
|
||||
readonly easeInCubic: (t: number) => number;
|
||||
readonly easeOutCubic: (t: number) => number;
|
||||
readonly easeInOutCubic: (t: number) => number;
|
||||
readonly easeInQuart: (t: number) => number;
|
||||
readonly easeOutQuart: (t: number) => number;
|
||||
readonly easeInOutQuart: (t: number) => number;
|
||||
readonly easeInQuint: (t: number) => number;
|
||||
readonly easeOutQuint: (t: number) => number;
|
||||
readonly easeInOutQuint: (t: number) => number;
|
||||
readonly easeInSine: (t: number) => number;
|
||||
readonly easeOutSine: (t: number) => number;
|
||||
readonly easeInOutSine: (t: number) => number;
|
||||
readonly easeInExpo: (t: number) => number;
|
||||
readonly easeOutExpo: (t: number) => number;
|
||||
readonly easeInOutExpo: (t: number) => number;
|
||||
readonly easeInCirc: (t: number) => number;
|
||||
readonly easeOutCirc: (t: number) => number;
|
||||
readonly easeInOutCirc: (t: number) => number;
|
||||
readonly easeInElastic: (t: number) => number;
|
||||
readonly easeOutElastic: (t: number) => number;
|
||||
readonly easeInOutElastic: (t: number) => number;
|
||||
readonly easeInBack: (t: number) => number;
|
||||
readonly easeOutBack: (t: number) => number;
|
||||
readonly easeInOutBack: (t: number) => number;
|
||||
readonly easeInBounce: (t: number) => number;
|
||||
readonly easeOutBounce: (t: number) => number;
|
||||
readonly easeInOutBounce: (t: number) => number;
|
||||
};
|
||||
export type EasingFunction = keyof typeof effects;
|
||||
export default effects;
|
||||
@ -1,45 +0,0 @@
|
||||
import type { ChartMeta, PointElement } from '../types/index.js';
|
||||
export declare function fontString(pixelSize: number, fontStyle: string, fontFamily: string): string;
|
||||
/**
|
||||
* Request animation polyfill
|
||||
*/
|
||||
export declare const requestAnimFrame: (((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame) | ((callback: any) => any);
|
||||
/**
|
||||
* Throttles calling `fn` once per animation frame
|
||||
* Latest arguments are used on the actual call
|
||||
*/
|
||||
export declare function throttled<TArgs extends Array<any>>(fn: (...args: TArgs) => void, thisArg: any): (...args: TArgs) => void;
|
||||
/**
|
||||
* Debounces calling `fn` for `delay` ms
|
||||
*/
|
||||
export declare function debounce<TArgs extends Array<any>>(fn: (...args: TArgs) => void, delay: number): (...args: TArgs) => number;
|
||||
/**
|
||||
* Converts 'start' to 'left', 'end' to 'right' and others to 'center'
|
||||
* @private
|
||||
*/
|
||||
export declare const _toLeftRightCenter: (align: 'start' | 'end' | 'center') => "center" | "left" | "right";
|
||||
/**
|
||||
* Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`
|
||||
* @private
|
||||
*/
|
||||
export declare const _alignStartEnd: (align: 'start' | 'end' | 'center', start: number, end: number) => number;
|
||||
/**
|
||||
* Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`
|
||||
* @private
|
||||
*/
|
||||
export declare const _textX: (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => number;
|
||||
/**
|
||||
* Return start and count of visible points.
|
||||
* @private
|
||||
*/
|
||||
export declare function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean): {
|
||||
start: number;
|
||||
count: number;
|
||||
};
|
||||
/**
|
||||
* Checks if the scale ranges have changed.
|
||||
* @param {object} meta - dataset meta.
|
||||
* @returns {boolean}
|
||||
* @private
|
||||
*/
|
||||
export declare function _scaleRangesChanged(meta: any): boolean;
|
||||
@ -1,22 +0,0 @@
|
||||
import type { Point, SplinePoint } from '../types/geometric.js';
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _pointInLine(p1: Point, p2: Point, t: number, mode?: any): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _steppedInterpolation(p1: Point, p2: Point, t: number, mode: 'middle' | 'after' | unknown): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?: any): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
@ -1 +0,0 @@
|
||||
export declare function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions): string;
|
||||
@ -1,84 +0,0 @@
|
||||
import type { Point } from '../types/geometric.js';
|
||||
/**
|
||||
* @alias Chart.helpers.math
|
||||
* @namespace
|
||||
*/
|
||||
export declare const PI: number;
|
||||
export declare const TAU: number;
|
||||
export declare const PITAU: number;
|
||||
export declare const INFINITY: number;
|
||||
export declare const RAD_PER_DEG: number;
|
||||
export declare const HALF_PI: number;
|
||||
export declare const QUARTER_PI: number;
|
||||
export declare const TWO_THIRDS_PI: number;
|
||||
export declare const log10: (x: number) => number;
|
||||
export declare const sign: (x: number) => number;
|
||||
export declare function almostEquals(x: number, y: number, epsilon: number): boolean;
|
||||
/**
|
||||
* Implementation of the nice number algorithm used in determining where axis labels will go
|
||||
*/
|
||||
export declare function niceNum(range: number): number;
|
||||
/**
|
||||
* Returns an array of factors sorted from 1 to sqrt(value)
|
||||
* @private
|
||||
*/
|
||||
export declare function _factorize(value: number): number[];
|
||||
export declare function isNumber(n: unknown): n is number;
|
||||
export declare function almostWhole(x: number, epsilon: number): boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _setMinAndMaxByKey(array: Record<string, number>[], target: {
|
||||
min: number;
|
||||
max: number;
|
||||
}, property: string): void;
|
||||
export declare function toRadians(degrees: number): number;
|
||||
export declare function toDegrees(radians: number): number;
|
||||
/**
|
||||
* Returns the number of decimal places
|
||||
* i.e. the number of digits after the decimal point, of the value of this Number.
|
||||
* @param x - A number.
|
||||
* @returns The number of decimal places.
|
||||
* @private
|
||||
*/
|
||||
export declare function _decimalPlaces(x: number): number;
|
||||
export declare function getAngleFromPoint(centrePoint: Point, anglePoint: Point): {
|
||||
angle: number;
|
||||
distance: number;
|
||||
};
|
||||
export declare function distanceBetweenPoints(pt1: Point, pt2: Point): number;
|
||||
/**
|
||||
* Shortest distance between angles, in either direction.
|
||||
* @private
|
||||
*/
|
||||
export declare function _angleDiff(a: number, b: number): number;
|
||||
/**
|
||||
* Normalize angle to be between 0 and 2*PI
|
||||
* @private
|
||||
*/
|
||||
export declare function _normalizeAngle(a: number): number;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean): boolean;
|
||||
/**
|
||||
* Limit `value` between `min` and `max`
|
||||
* @param value
|
||||
* @param min
|
||||
* @param max
|
||||
* @private
|
||||
*/
|
||||
export declare function _limitValue(value: number, min: number, max: number): number;
|
||||
/**
|
||||
* @param {number} value
|
||||
* @private
|
||||
*/
|
||||
export declare function _int16Range(value: number): number;
|
||||
/**
|
||||
* @param value
|
||||
* @param start
|
||||
* @param end
|
||||
* @param [epsilon]
|
||||
* @private
|
||||
*/
|
||||
export declare function _isBetween(value: number, start: number, end: number, epsilon?: number): boolean;
|
||||
@ -1,97 +0,0 @@
|
||||
import type { ChartArea, FontSpec, Point } from '../types/index.js';
|
||||
import type { TRBL, TRBLCorners } from '../types/geometric.js';
|
||||
/**
|
||||
* @alias Chart.helpers.options
|
||||
* @namespace
|
||||
*/
|
||||
/**
|
||||
* Converts the given line height `value` in pixels for a specific font `size`.
|
||||
* @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').
|
||||
* @param size - The font size (in pixels) used to resolve relative `value`.
|
||||
* @returns The effective line height in pixels (size * 1.2 if value is invalid).
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function toLineHeight(value: number | string, size: number): number;
|
||||
/**
|
||||
* @param value
|
||||
* @param props
|
||||
*/
|
||||
export declare function _readValueToProps<K extends string>(value: number | Record<K, number>, props: K[]): Record<K, number>;
|
||||
export declare function _readValueToProps<K extends string, T extends string>(value: number | Record<K & T, number>, props: Record<T, K>): Record<T, number>;
|
||||
/**
|
||||
* Converts the given value into a TRBL object.
|
||||
* @param value - If a number, set the value to all TRBL component,
|
||||
* else, if an object, use defined properties and sets undefined ones to 0.
|
||||
* x / y are shorthands for same value for left/right and top/bottom.
|
||||
* @returns The padding values (top, right, bottom, left)
|
||||
* @since 3.0.0
|
||||
*/
|
||||
export declare function toTRBL(value: number | TRBL | Point): Record<"left" | "top" | "bottom" | "right", number>;
|
||||
/**
|
||||
* Converts the given value into a TRBL corners object (similar with css border-radius).
|
||||
* @param value - If a number, set the value to all TRBL corner components,
|
||||
* else, if an object, use defined properties and sets undefined ones to 0.
|
||||
* @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)
|
||||
* @since 3.0.0
|
||||
*/
|
||||
export declare function toTRBLCorners(value: number | TRBLCorners): Record<"topLeft" | "topRight" | "bottomLeft" | "bottomRight", number>;
|
||||
/**
|
||||
* Converts the given value into a padding object with pre-computed width/height.
|
||||
* @param value - If a number, set the value to all TRBL component,
|
||||
* else, if an object, use defined properties and sets undefined ones to 0.
|
||||
* x / y are shorthands for same value for left/right and top/bottom.
|
||||
* @returns The padding values (top, right, bottom, left, width, height)
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function toPadding(value?: number | TRBL): ChartArea;
|
||||
/**
|
||||
* Parses font options and returns the font object.
|
||||
* @param options - A object that contains font options to be parsed.
|
||||
* @param fallback - A object that contains fallback font options.
|
||||
* @return The font object.
|
||||
* @private
|
||||
*/
|
||||
export declare function toFont(options: Partial<FontSpec>, fallback?: Partial<FontSpec>): {
|
||||
family: string;
|
||||
lineHeight: number;
|
||||
size: number;
|
||||
style: "normal" | "inherit" | "italic" | "oblique" | "initial";
|
||||
weight: number | "bold" | "normal" | "lighter" | "bolder";
|
||||
string: string;
|
||||
};
|
||||
/**
|
||||
* Evaluates the given `inputs` sequentially and returns the first defined value.
|
||||
* @param inputs - An array of values, falling back to the last value.
|
||||
* @param context - If defined and the current value is a function, the value
|
||||
* is called with `context` as first argument and the result becomes the new input.
|
||||
* @param index - If defined and the current value is an array, the value
|
||||
* at `index` become the new input.
|
||||
* @param info - object to return information about resolution in
|
||||
* @param info.cacheable - Will be set to `false` if option is not cacheable.
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function resolve(inputs: Array<unknown>, context?: object, index?: number, info?: {
|
||||
cacheable: boolean;
|
||||
}): unknown;
|
||||
/**
|
||||
* @param minmax
|
||||
* @param grace
|
||||
* @param beginAtZero
|
||||
* @private
|
||||
*/
|
||||
export declare function _addGrace(minmax: {
|
||||
min: number;
|
||||
max: number;
|
||||
}, grace: number | string, beginAtZero: boolean): {
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
/**
|
||||
* Create a context inheriting parentContext
|
||||
* @param parentContext
|
||||
* @param context
|
||||
* @returns
|
||||
*/
|
||||
export declare function createContext<T extends object>(parentContext: null, context: T): T;
|
||||
export declare function createContext<T extends object, P extends T>(parentContext: P, context: T): P & T;
|
||||
@ -1,10 +0,0 @@
|
||||
export interface RTLAdapter {
|
||||
x(x: number): number;
|
||||
setWidth(w: number): void;
|
||||
textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';
|
||||
xPlus(x: number, value: number): number;
|
||||
leftForLtr(x: number, itemWidth: number): number;
|
||||
}
|
||||
export declare function getRtlAdapter(rtl: boolean, rectX: number, width: number): RTLAdapter;
|
||||
export declare function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl'): void;
|
||||
export declare function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]): void;
|
||||
@ -1,65 +0,0 @@
|
||||
/**
|
||||
* Returns the sub-segment(s) of a line segment that fall in the given bounds
|
||||
* @param {object} segment
|
||||
* @param {number} segment.start - start index of the segment, referring the points array
|
||||
* @param {number} segment.end - end index of the segment, referring the points array
|
||||
* @param {boolean} segment.loop - indicates that the segment is a loop
|
||||
* @param {object} [segment.style] - segment style
|
||||
* @param {PointElement[]} points - the points that this segment refers to
|
||||
* @param {object} [bounds]
|
||||
* @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.
|
||||
* @param {number} bounds.start - start value of the property
|
||||
* @param {number} bounds.end - end value of the property
|
||||
* @private
|
||||
**/
|
||||
export function _boundSegment(segment: {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: object;
|
||||
}, points: PointElement[], bounds?: {
|
||||
property: string;
|
||||
start: number;
|
||||
end: number;
|
||||
}): {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: object;
|
||||
}[];
|
||||
/**
|
||||
* Returns the segments of the line that are inside given bounds
|
||||
* @param {LineElement} line
|
||||
* @param {object} [bounds]
|
||||
* @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.
|
||||
* @param {number} bounds.start - start value of the `property`
|
||||
* @param {number} bounds.end - end value of the `property`
|
||||
* @private
|
||||
*/
|
||||
export function _boundSegments(line: LineElement, bounds?: {
|
||||
property: string;
|
||||
start: number;
|
||||
end: number;
|
||||
}): {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: object;
|
||||
}[];
|
||||
/**
|
||||
* Compute the continuous segments that define the whole line
|
||||
* There can be skipped points within a segment, if spanGaps is true.
|
||||
* @param {LineElement} line
|
||||
* @param {object} [segmentOptions]
|
||||
* @return {Segment[]}
|
||||
* @private
|
||||
*/
|
||||
export function _computeSegments(line: LineElement, segmentOptions?: object): Segment[];
|
||||
export type LineElement = import('../elements/element.line.js').default;
|
||||
export type PointElement = import('../elements/element.point.js').default;
|
||||
export type Segment = {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: any;
|
||||
};
|
||||
16
staticfiles/chart.js/dist/helpers/index.d.ts
vendored
16
staticfiles/chart.js/dist/helpers/index.d.ts
vendored
@ -1,16 +0,0 @@
|
||||
export * from './helpers.color.js';
|
||||
export * from './helpers.core.js';
|
||||
export * from './helpers.canvas.js';
|
||||
export * from './helpers.collection.js';
|
||||
export * from './helpers.config.js';
|
||||
export * from './helpers.curve.js';
|
||||
export * from './helpers.dom.js';
|
||||
export { default as easingEffects } from './helpers.easing.js';
|
||||
export * from './helpers.extras.js';
|
||||
export * from './helpers.interpolation.js';
|
||||
export * from './helpers.intl.js';
|
||||
export * from './helpers.options.js';
|
||||
export * from './helpers.math.js';
|
||||
export * from './helpers.rtl.js';
|
||||
export * from './helpers.segment.js';
|
||||
export * from './helpers.dataset.js';
|
||||
12
staticfiles/chart.js/dist/index.d.ts
vendored
12
staticfiles/chart.js/dist/index.d.ts
vendored
@ -1,12 +0,0 @@
|
||||
export * from './controllers/index.js';
|
||||
export * from './core/index.js';
|
||||
export * from './elements/index.js';
|
||||
export * from './platform/index.js';
|
||||
export * from './plugins/index.js';
|
||||
export * from './scales/index.js';
|
||||
import * as controllers from './controllers/index.js';
|
||||
import * as elements from './elements/index.js';
|
||||
import * as plugins from './plugins/index.js';
|
||||
import * as scales from './scales/index.js';
|
||||
export { controllers, elements, plugins, scales, };
|
||||
export declare const registerables: (typeof controllers | typeof elements | typeof plugins | typeof scales)[];
|
||||
5
staticfiles/chart.js/dist/index.umd.d.ts
vendored
5
staticfiles/chart.js/dist/index.umd.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
/**
|
||||
* @namespace Chart
|
||||
*/
|
||||
import Chart from './core/core.controller.js';
|
||||
export default Chart;
|
||||
@ -1,5 +0,0 @@
|
||||
export function _detectPlatform(canvas: any): typeof BasicPlatform | typeof DomPlatform;
|
||||
import BasicPlatform from "./platform.basic.js";
|
||||
import DomPlatform from "./platform.dom.js";
|
||||
import BasePlatform from "./platform.base.js";
|
||||
export { BasePlatform, BasicPlatform, DomPlatform };
|
||||
@ -1,63 +0,0 @@
|
||||
/**
|
||||
* @typedef { import('../core/core.controller.js').default } Chart
|
||||
*/
|
||||
/**
|
||||
* Abstract class that allows abstracting platform dependencies away from the chart.
|
||||
*/
|
||||
export default class BasePlatform {
|
||||
/**
|
||||
* Called at chart construction time, returns a context2d instance implementing
|
||||
* the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.
|
||||
* @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)
|
||||
* @param {number} [aspectRatio] - The chart options
|
||||
*/
|
||||
acquireContext(canvas: HTMLCanvasElement, aspectRatio?: number): void;
|
||||
/**
|
||||
* Called at chart destruction time, releases any resources associated to the context
|
||||
* previously returned by the acquireContext() method.
|
||||
* @param {CanvasRenderingContext2D} context - The context2d instance
|
||||
* @returns {boolean} true if the method succeeded, else false
|
||||
*/
|
||||
releaseContext(context: CanvasRenderingContext2D): boolean;
|
||||
/**
|
||||
* Registers the specified listener on the given chart.
|
||||
* @param {Chart} chart - Chart from which to listen for event
|
||||
* @param {string} type - The ({@link ChartEvent}) type to listen for
|
||||
* @param {function} listener - Receives a notification (an object that implements
|
||||
* the {@link ChartEvent} interface) when an event of the specified type occurs.
|
||||
*/
|
||||
addEventListener(chart: Chart, type: string, listener: Function): void;
|
||||
/**
|
||||
* Removes the specified listener previously registered with addEventListener.
|
||||
* @param {Chart} chart - Chart from which to remove the listener
|
||||
* @param {string} type - The ({@link ChartEvent}) type to remove
|
||||
* @param {function} listener - The listener function to remove from the event target.
|
||||
*/
|
||||
removeEventListener(chart: Chart, type: string, listener: Function): void;
|
||||
/**
|
||||
* @returns {number} the current devicePixelRatio of the device this platform is connected to.
|
||||
*/
|
||||
getDevicePixelRatio(): number;
|
||||
/**
|
||||
* Returns the maximum size in pixels of given canvas element.
|
||||
* @param {HTMLCanvasElement} element
|
||||
* @param {number} [width] - content width of parent element
|
||||
* @param {number} [height] - content height of parent element
|
||||
* @param {number} [aspectRatio] - aspect ratio to maintain
|
||||
*/
|
||||
getMaximumSize(element: HTMLCanvasElement, width?: number, height?: number, aspectRatio?: number): {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
/**
|
||||
* @param {HTMLCanvasElement} canvas
|
||||
* @returns {boolean} true if the canvas is attached to the platform, false if not.
|
||||
*/
|
||||
isAttached(canvas: HTMLCanvasElement): boolean;
|
||||
/**
|
||||
* Updates config with platform specific requirements
|
||||
* @param {import('../core/core.config.js').default} config
|
||||
*/
|
||||
updateConfig(config: import('../core/core.config.js').default): void;
|
||||
}
|
||||
export type Chart = import('../core/core.controller.js').default;
|
||||
@ -1,10 +0,0 @@
|
||||
/**
|
||||
* Platform class for charts without access to the DOM or to many element properties
|
||||
* This platform is used by default for any chart passed an OffscreenCanvas.
|
||||
* @extends BasePlatform
|
||||
*/
|
||||
export default class BasicPlatform extends BasePlatform {
|
||||
acquireContext(item: any): any;
|
||||
updateConfig(config: any): void;
|
||||
}
|
||||
import BasePlatform from "./platform.base.js";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user