yzsp-studio/mediakit-shared-suite / ppt
ppt
Unverified飞书幻灯片:创建和编辑幻灯片。创建演示文稿、读取幻灯片内容、管理幻灯片页面(创建、删除、读取、局部替换)。当用户需要创建或编辑幻灯片、读取或修改单个页面时使用。
scripts/svg_relation_lib/attributes/signed.py
View on GitHub"""
A2 · Signed attribute · positive / negative / neutral polarity
字段:sign ∈ {'+', '-', '='}
默认视觉通道:color_semantic (green / red / gray)
备用通道:arrow_shape
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple
_SEMANTIC_COLORS = {
"+": "#16a34a", # green-600
"-": "#dc2626", # red-600
"=": "#64748b", # slate-500
}
_ARROW_SHAPES = {
"+": "triangle",
"-": "bar",
"=": "diamond",
}
@dataclass
class Signed:
"""Signed attribute · edge polarity。"""
field_name: str = "sign"
v1_aliases: Tuple[str, ...] = ()
channel: str = "color_semantic"
fallback_channel: str = "arrow_shape"
def resolve_value(self, element: dict) -> Optional[str]:
"""从 element dict 里取值 · 归一到 '+/-/='。"""
for name in (self.field_name,) + tuple(self.v1_aliases):
if name in element and element[name] is not None:
v = str(element[name]).strip().lower()
if v in ("+", "positive", "pos", "up", "gain"):
return "+"
if v in ("-", "negative", "neg", "down", "loss"):
return "-"
if v in ("=", "0", "neutral", "flat", "stable"):
return "="
if v in _SEMANTIC_COLORS:
return v
return None
def encode(self, value: str, channel: str, palette=None) -> dict:
if channel == "color_semantic":
color = _SEMANTIC_COLORS.get(value, "#64748b")
return {"stroke": color, "fill": color}
if channel == "arrow_shape":
return {"marker-shape": _ARROW_SHAPES.get(value, "triangle")}
return {}
DEFAULT_SIGNED = Signed()
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 |