Skillpedia
التحليل وجداول البيانات41k · #6900

choosing-trend-or-slope-view

ما الذي تفعله

تساعدك هذه المهارة على اختيار المخطط الصحيح عندما يسأل أحدهم كيف تغيّر شيء بين نقطتين. وهي مناسبة لكل من يريد مخططاً يطابق سؤاله.

متى تستخدمها

  • ✓عندما تسأل كم نما شيء أو انخفض بين تاريخين.
  • ✓عندما تريد أن ترى كيف تحرك مقياس عبر الفترة كلها، بما في ذلك الارتفاعات المفاجئة.
  • ✓عندما تريد مقارنة سلاسل كثيرة من خلال قيمها في البداية والنهاية.

رابط المهارة

https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/choosing-trend-or-slope-view/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/choosing-trend-or-slope-view/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“كم تغيّر عدد التسجيلات من يناير إلى مارس؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

إذا كان الطلب قد يعني المسار الكامل أو البداية والنهاية فقط، تطرح المهارة سؤالاً قصيراً أولاً. وكلا المخططين يأتيان من الاستعلام نفسه على نطاق التاريخ نفسه، ويحتفظ مخطط المنحدر بالنقطة الأولى والأخيرة فقط.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Choosing a trend line vs a slope view

"How did X change between A and B?" is ambiguous. Two charts answer two different questions, so clarify before you build unless the user already named one:

  • Change over time (line) — the value at every interval across the range. Shows the path: dips, spikes, when it moved. This is the default trend.
  • Start vs end (slope) — only the first and last point, one line per series connecting them. Shows the net change and, across many series, which rose, which fell, and any rank flips — without the noise of the path between.

When the request could be either, ask a short either/or, e.g.:

Do you want to see how it moved across the whole period (a line chart), or just the change from the start to the end (a slope chart)?

If the user clearly wants one — "just tell me how much it grew start to end" → slope; "show me the trend / when did it spike" → line — skip the question and build it.

How to render each

Both come from the same TrendsQuery over the same date range — the slope is that series collapsed to its first and last point, not a different query.

Change over time → line

Default trends behavior. Create or run a TrendsQuery and leave trendsFilter.display as ActionsLineGraph (the default, "change over time"):

{
  "kind": "TrendsQuery",
  "series": [{ "kind": "EventsNode", "event": "$pageview", "math": "total" }],
  "dateRange": { "date_from": "2025-01-01", "date_to": "2025-03-31" },
  "trendsFilter": { "display": "ActionsLineGraph" }
}

Start vs end → slope

Run the trend with posthog:query-trends. The result card Max renders has a Line / Bar / Slope view toggle — switch it to Slope to show each series as a single line from its first to its last point, with the per-series change in the legend. Tell the user they can flip to the Slope view on the result.

The slope view is best for a clean before→after comparison, especially with several series/categories whose relative movement matters. Pick a date range whose two ends are the points you want compared (the slope uses the first and last interval).

Important limits

  • Two surfaces, one computation. Both the inline slope (Max's query-trends result card) and the saved-insight slope (ChartDisplayType.SlopeGraph) show the same thing: the first interval's value vs the last interval's value, at the chosen group-by interval. The grouping defines the slope - group by month to compare the first vs last month, by day for the first vs last day. Use the inline view for a quick before-and-after on a result you're already looking at; use the saved display to persist it on a dashboard. A still-accumulating final period is shown as-is with a dashed connector, the same affordance the line chart uses for an incomplete tail.
  • For period-over-period on a single series (this month vs last), a line with compareFilter: { "compare": true } overlays the two periods; a slope is the better fit when comparing the endpoints of many series at once.
الأسئلة الشائعة

هل يعتمد المخططان على بيانات مختلفة؟

لا. يأتي كلاهما من استعلام الاتجاهات نفسه على نطاق التاريخ نفسه، ويحتفظ مخطط المنحدر بالنقطة الأولى والأخيرة فقط.

ماذا لو كنت أعرف المخطط الذي أريده؟

إذا طلبت واحداً بوضوح، تبنيه المهارة دون سؤال.

متى يكون مخطط المنحدر أفضل؟

يكون أفضل لإظهار صافي التغيير وتغيّر الترتيب عبر سلاسل كثيرة، دون الضجيج الموجود بينهما.

التفاصيل

الوصف الأصلي من المؤلف

Clarify how to visualize change over a time range before building a trend. Use whenever the user asks how much something changed, grew, dropped, improved, or regressed between two points or periods — "how much did X change from A to B", "before vs after", "start vs end", "week over week", "compare this month to last", "change over time" — or mentions a "slope chart" / "slopegraph". Two readings of "change" need different charts: the whole trend (a line, every interval) versus just the two endpoints (a slope, start vs end). Ask which they want, then render it. Not for choosing a saved insight C

repo: PostHog/posthog

الشعبية

نجوم GitHub
41k
الترتيب
#6900
الترخيص
—
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة