yzsp-studio/mediakit-shared-suite / ppt
ppt
Unverified飞书幻灯片:创建和编辑幻灯片。创建演示文稿、读取幻灯片内容、管理幻灯片页面(创建、删除、读取、局部替换)。当用户需要创建或编辑幻灯片、读取或修改单个页面时使用。
scripts/svg_relation_lib/attributes/size.py
View on GitHub"""
A6 · Size attribute · node radius / font scale
字段:size (float)
默认视觉通道:radius_sqrt (面积正比 size)
备用通道:font_size
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple
import math
@dataclass
class Size:
"""Size attribute · node 尺寸。"""
field_name: str = "size"
v1_aliases: Tuple[str, ...] = ("magnitude", "count")
channel: str = "radius_sqrt"
fallback_channel: str = "font_size"
def resolve_value(self, element: dict) -> Optional[float]:
for name in (self.field_name,) + tuple(self.v1_aliases):
if name in element and element[name] is not None:
try:
return float(element[name])
except (TypeError, ValueError):
return None
return None
def encode(self, value: float, channel: str, palette=None) -> dict:
v = max(value, 0.0)
if channel == "radius_sqrt":
# 面积正比 value · r = sqrt(value) * scale + base
r = math.sqrt(v) * 4.0 + 8.0
return {"r": r}
if channel == "font_size":
# base 12 · scale by sqrt
fs = 10.0 + math.sqrt(v) * 2.0
return {"font-size": fs}
return {}
DEFAULT_SIZE = Size()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |