diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c2b34a7 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/at-transit-images.zip b/at-transit-images.zip new file mode 100644 index 0000000..4589e1b Binary files /dev/null and b/at-transit-images.zip differ diff --git a/e04610a8-c18e-400b-ad67-d8cd8067dfe3.jpeg b/e04610a8-c18e-400b-ad67-d8cd8067dfe3.jpeg new file mode 100644 index 0000000..6b7b219 Binary files /dev/null and b/e04610a8-c18e-400b-ad67-d8cd8067dfe3.jpeg differ diff --git a/flow_ui/.DS_Store b/flow_ui/.DS_Store new file mode 100644 index 0000000..50c27e7 Binary files /dev/null and b/flow_ui/.DS_Store differ diff --git a/flow_ui/build_click_flow.py b/flow_ui/build_click_flow.py new file mode 100644 index 0000000..2e1fc83 --- /dev/null +++ b/flow_ui/build_click_flow.py @@ -0,0 +1,873 @@ +#!/usr/bin/env python3 +"""Horizontal click-flow diagram with row-aware centering and orthogonal arrows.""" +import asyncio +import random +from pathlib import Path +from playwright.async_api import async_playwright +from PIL import Image, ImageDraw, ImageFont +from math import atan2, cos, sin + +Image.MAX_IMAGE_PIXELS = None + +ROOT = Path(__file__).resolve().parent.parent +UI_DIR = ROOT / "flow_ui" / "ui" +SHOTS_DIR = ROOT / "flow_ui" / "screenshots" +OUT_PNG = ROOT / "flow_ui" / "frontend-web-transit-flow.png" +VIEWPORT = {"width": 1600, "height": 1000} +OUTPUT_SCALE = 2 + +# id, page, selector_or_None, col, row, marker_label, panel_title, span_rows, align_mode +# row: integer row index (0=top). span_rows: if >1, node is centered across N rows. +# align_mode: "top" or "center-row" (centered vertically within its row band when span_rows == 1) +NODES = [ + # Row 0 (top) — stop discovery flow + ("N1", "index.html", None, + 0, 0, "", "index.html", 1, "top"), + ("N2a", "index.html", '.mu-nav a[href="./busStop.html"]', + 1, 0, "คลิก 'ป้ายหยุดรถ'", "index.html · ป้ายหยุดรถ", 1, "top"), + ("N3a", "busStop.html", ".mu-stop-grid li:nth-of-type(1) a.mu-row-link", + 2, 0, "คลิกจุดจอด 'บขส.อ่างทอง'", "busStop.html", 1, "center-row"), + ("N4a", "stopDetail.html", None, + 4, 0, "ถึงรายละเอียดป้าย ?stop=at_main_terminal", "stopDetail.html", 1, "center-row"), + ("N4b", "stopDetailExpanded.html", ".mu-stop-expander[open] .mu-route-chip", + 5, 0, "ขยายข้อมูลเวลารถในป้าย", "stopDetail.html (expanded)", 1, "center-row"), + # Row 1 (bottom) — route detail flow + ("N2b", "index.html", ".mu-zone:nth-of-type(3) .mu-card:nth-of-type(1)", + 1, 1, "คลิกหมายเลขสาย 101", "index.html · สาย 101", 1, "top"), + ("N3b", "busDetail.html", ".mu-stop-expander:nth-of-type(1) summary", + 2, 1, "ขยายจุดจอด 'บขส.อ่างทอง'", "busDetail.html", 1, "center-row"), + ("N4c", "busDetailExpanded.html", ".mu-stop-expander[open] .mu-inline-actions .mu-btn.ghost", + 3, 1, "คลิก 'ไปหน้ารายละเอียดจุดจอด'", "busDetail.html (expanded)", 1, "center-row"), +] + +EDGES = [ + ("N1", "N2a"), ("N1", "N2b"), + ("N2a", "N3a"), ("N2b", "N3b"), + ("N3a", "N4a"), ("N3b", "N4c"), + ("N4c", "N4a"), ("N4a", "N4b"), +] + +PAGES = sorted({n[1] for n in NODES}) + +STOP_DETAIL_ACTIONS = [ + ("A1", "stopDetail.html", "N4", "ดูตารางเวลาสายรถ", "busDetail.html", "N3", "?stop=at_main_terminal"), + ("A2", "stopDetail.html", "N4", "เปิดรายละเอียดสาย 101", "busDetail.html", "N3", "?route=101&origin=at_main_terminal"), + ("A3", "stopDetail.html", "N4", "กลับไปรายการป้าย", "busStop.html", "N2", "กลับหน้า list"), + ("A4", "stopDetail.html", "N4", "กลับหน้าแรก (breadcrumb)", "index.html", "N1", "ผ่าน breadcrumb"), + ("A5", "stopDetail.html", "N4", "ขยายเวลารถของสาย", "stopDetailExpanded", "N4e", "state transition"), +] + +async def capture_all(): + SHOTS_DIR.mkdir(parents=True, exist_ok=True) + boxes, sizes = {}, {} + state_page_map = { + "stopDetailExpanded.html": "stopDetail.html", + "busDetailExpanded.html": "busDetail.html", + } + async with async_playwright() as p: + browser = await p.chromium.launch() + ctx = await browser.new_context(viewport=VIEWPORT, device_scale_factor=1) + page = await ctx.new_page() + for name in PAGES: + # Expanded screenshots are captured from their base page with UI state toggled before snapshot. + source_name = state_page_map.get(name, name) + url = (UI_DIR / source_name).resolve().as_uri() + await page.goto(url, wait_until="networkidle") + await page.wait_for_timeout(400) + if name in state_page_map: + await page.evaluate( + """ + () => { + const first = document.querySelector('.mu-stop-expander'); + if (first) first.open = true; + } + """ + ) + await page.wait_for_timeout(120) + doc = await page.evaluate( + "({w: document.documentElement.scrollWidth, h: document.documentElement.scrollHeight})") + sizes[name] = (doc["w"], doc["h"]) + await page.screenshot(path=str(SHOTS_DIR / name.replace(".html", ".png")), full_page=True) + for nid, p_name, sel, *_ in NODES: + if p_name != name or not sel: + continue + el = await page.query_selector(sel) + if not el: + print(f"WARN missing {sel} on {name}") + continue + boxes[nid] = await el.bounding_box() + print(f"captured {name} {sizes[name]}") + await browser.close() + return boxes, sizes + +def get_font(size): + for path in [ + "/System/Library/Fonts/Supplemental/Arial Unicode.ttf", + "/System/Library/Fonts/Supplemental/Tahoma.ttf", + ]: + try: + return ImageFont.truetype(path, size) + except Exception: + pass + return ImageFont.load_default() + +def hex_to_rgb(value): + value = value.lstrip("#") + return tuple(int(value[i:i+2], 16) for i in (0, 2, 4)) + +def draw_cursor_icon(base_img, tip_x, tip_y, color_hex, scale=1.0): + # Render only the split two-prong motif (no main arrow-head triangle). + ss = 6 + icon_w = int(30 * scale) + icon_h = int(30 * scale) + local = Image.new("RGBA", (icon_w * ss, icon_h * ss), (0, 0, 0, 0)) + d = ImageDraw.Draw(local) + + core = (int(9 * scale * ss), int(9 * scale * ss)) + + # Two-prong symbol balanced to avoid obscuring the center core. + prong_right = [ + core, + (int(32 * scale * ss), int(18 * scale * ss)), + (int(19 * scale * ss), int(19 * scale * ss)), + ] + prong_down = [ + core, + (int(18 * scale * ss), int(32 * scale * ss)), + (int(19 * scale * ss), int(19 * scale * ss)), + ] + connector = [ + core, + (int(19 * scale * ss), int(19 * scale * ss)), + (int(16 * scale * ss), int(22 * scale * ss)), + (int(22 * scale * ss), int(16 * scale * ss)), + ] + + r, g, b = hex_to_rgb(color_hex) + d.polygon(prong_right, fill=(r, g, b, 248)) + d.polygon(prong_down, fill=(r, g, b, 248)) + d.polygon(connector, fill=(r, g, b, 248)) + d.ellipse( + [ + core[0] - int(1.6 * ss), + core[1] - int(1.6 * ss), + core[0] + int(1.6 * ss), + core[1] + int(1.6 * ss), + ], + fill=(r, g, b, 255), + ) + + local = local.resize((icon_w, icon_h), Image.Resampling.LANCZOS) + px = int(tip_x - 8 * scale) + py = int(tip_y - 8 * scale) + base_img.paste(local, (px, py), local) + +def compose(boxes, sizes): + s = OUTPUT_SCALE + cell_w = int(900 * s) + margin_h, margin_v = int(40 * s), int(30 * s) + # Keep enough horizontal/vertical whitespace so connectors stay visible. + gutter_h = int(440 * s) + row_gap = int(240 * s) + label_block_h = int(48 * s) + px_per_col = cell_w + gutter_h + grid = {} + for nid, page, sel, col, row, marker_lbl, title, span_rows, align_mode in NODES: + grid[nid] = { + "col": col, "row": row, "span_rows": span_rows, + "marker_label": marker_lbl, "title": title, + "align_mode": align_mode, + "page": page, "selector": sel + } + # Precompute scaled sizes for each node and dynamic row heights. + scaled_sizes = {} + for nid, page, *_ in NODES: + page_w, page_h = sizes.get(page, (cell_w, 800)) + scale = cell_w / page_w if page_w else 1 + scaled_w = int(page_w * scale) + scaled_h = int(page_h * scale) + scaled_sizes[nid] = (scaled_w, scaled_h) + + unique_rows = sorted(set(n[4] for n in NODES)) + row_heights = {} + for row in unique_rows: + row_nodes = [n[0] for n in NODES if n[4] == row] + row_heights[row] = max((scaled_sizes[nid][1] for nid in row_nodes), default=800) + + row_tops = {} + cursor_y = margin_v + for row in unique_rows: + row_tops[row] = cursor_y + cursor_y += row_heights[row] + label_block_h + row_gap + # Compute bounds + cols = [n[3] for n in NODES] + rows = [n[4] for n in NODES] + max_col = max(cols) if cols else 0 + max_row = max(rows) if rows else 0 + canvas_w = (max_col + 1) * px_per_col + 2 * margin_h + canvas_h = cursor_y + margin_v + img = Image.new("RGB", (int(canvas_w), int(canvas_h)), "white") + draw = ImageDraw.Draw(img) + font_label = get_font(int(12 * s)) + font_title = get_font(int(13 * s)) + font_arrow = get_font(int(12 * s)) + font_marker = get_font(int(11 * s)) + + # Per-node action color: deterministic random so output is stable across runs. + color_rng = random.Random(20260512) + color_palette = [ + "#2563eb", "#7c3aed", "#db2777", "#ea580c", + "#0f766e", "#0891b2", "#4338ca", "#be123c", + ] + action_colors = {nid: color_rng.choice(color_palette) for nid, *_ in NODES} + # Draw node panels: each is a screenshot at target grid cell with rounded corners + node_boxes = {} + click_points = {} + for nid, page, sel, col, row, marker_lbl, title, span_rows, align_mode in NODES: + # Load screenshot + png_path = SHOTS_DIR / page.replace(".html", ".png") + if not png_path.exists(): + print(f"WARN no screenshot {png_path}") + continue + ss = Image.open(png_path) + page_w, page_h = ss.size + # Compute panel position + px = margin_h + col * px_per_col + py = row_tops[row] + label_block_h + # Scale screenshot + scale = cell_w / page_w + scaled_w = int(page_w * scale) + scaled_h = int(page_h * scale) + # Vertical centering within row band(s) for all nodes. + span_rows_list = [row + i for i in range(span_rows)] + band_h = sum(row_heights.get(r, row_heights[row]) for r in span_rows_list) + row_gap * (span_rows - 1) + if scaled_h < band_h: + py += (band_h - scaled_h) // 2 + # Horizontal centering within column cell + if scaled_w < px_per_col: + px += (px_per_col - scaled_w) // 2 + ss_scaled = ss.resize((scaled_w, scaled_h), Image.Resampling.LANCZOS) + # Paste onto main canvas + img.paste(ss_scaled, (int(px), int(py))) + # Record bounds for arrow drawing + node_boxes[nid] = (px, py, px + scaled_w, py + scaled_h) + # Record click marker position from selector bounding box on original page. + if nid in boxes and boxes[nid]: + b = boxes[nid] + cx = px + (b["x"] + b["width"] / 2) * scale + cy = py + (b["y"] + b["height"] / 2) * scale + click_points[nid] = (cx, cy) + # Add colored bar with filename/title and action description above screenshot. + action_color = action_colors.get(nid, "#1f4f7a") + bar_h = int(42 * s) + bar_y1 = py - label_block_h + bar_y2 = bar_y1 + bar_h + # Draw full-width colored bar + draw.rectangle([px, bar_y1, px + scaled_w, bar_y2], fill=action_color) + # Draw title and marker label inside bar + title_y = bar_y1 + int(12 * s) + draw.text((px + int(8 * s), title_y), title, fill="#ffffff", font=font_title, anchor="lm") + desc_y = bar_y1 + int(28 * s) + draw.text((px + int(8 * s), desc_y), marker_lbl, fill="#ffffff", font=font_label, anchor="lm") + + def draw_edge_label(text, x, y, label_color="#1f4f7a"): + pad_x = int(12 * s) + pad_y = int(6 * s) + font_bold = get_font(int(14 * s)) + text_w = draw.textlength(text, font=font_bold) + text_h = int(16 * s) + x1 = x - text_w / 2 - pad_x + y1 = y - text_h / 2 - pad_y + x2 = x + text_w / 2 + pad_x + y2 = y + text_h / 2 + pad_y + draw.rounded_rectangle([x1, y1, x2, y2], radius=int(8 * s), fill=label_color, outline="#ffffff", width=int(2 * s)) + draw.text((x, y), text, fill="#ffffff", font=font_bold, anchor="mm") + + def draw_soft_gradient_circle(base_img, cx, cy, rgb): + # Render gradient on a local RGBA surface, then composite to keep soft edges. + circle_scale = 1.3 * 1.2 * s + outer = int(round(20 * circle_scale)) + inner = int(round(9 * circle_scale)) + pad = int(4 * s) + size = outer * 2 + pad * 2 + local = Image.new("RGBA", (size, size), (0, 0, 0, 0)) + ld = ImageDraw.Draw(local) + + center = outer + pad + r, g, b = rgb + + # Outer soft halo. + for rr in range(outer, inner, -1): + t = (rr - inner) / max(1, (outer - inner)) + alpha = int(12 + (1 - t) * 56) + ld.ellipse( + [center - rr, center - rr, center + rr, center + rr], + fill=(r, g, b, alpha), + ) + + # Inner light core for the "soft gradient" look. + for rr in range(inner, 2, -1): + t = rr / max(1, inner) + alpha = int(110 + (1 - t) * 80) + ld.ellipse( + [center - rr, center - rr, center + rr, center + rr], + fill=(255, 255, 255, alpha), + ) + + # Crisp center dot to preserve click focal point. + dot = max(2, int(2 * s)) + ld.ellipse([center - dot, center - dot, center + dot, center + dot], fill=(r, g, b, 230)) + base_img.paste(local, (cx - center, cy - center), local) + + def draw_click_marker(nid, x, y): + # Normal cursor orientation with tip at click center. + cx = int(x) + cy = int(y) + + action_color = action_colors.get(nid, "#334155") + r, g, b = hex_to_rgb(action_color) + + # Soft gradient circle that shares the same hue as action label text. + draw_soft_gradient_circle(img, cx, cy, (r, g, b)) + + # Upright cursor with anti-aliased edges; tip lands exactly on click center. + draw_cursor_icon(img, cx, cy, action_color, scale=1.38 * s) + + # Arrow routing: orthogonal with elbow + src_gap = int(15 * s) + dst_gap = int(10 * s) + def route_arrow(p1, p2, src_y_offset=0, dst_y_offset=0): + """Return [(x_start, y0), (x_elbow, y0), (x_elbow, y1), (x_end, y1)].""" + x0, y0, x1_r, y1_r = p1 + x2, y2, x3_r, y3_r = p2 + src_y = (y0 + y1_r) / 2 + src_y_offset + dst_y = (y2 + y3_r) / 2 + dst_y_offset + mid_x = x1_r + (x2 - x1_r) * 0.25 + return [(x1_r + src_gap, src_y), (mid_x, src_y), (mid_x, dst_y), (x2 - dst_gap, dst_y)] + arrow_width = int(5 * s) + # Count outgoing and incoming edges per node to compute per-edge y-offsets. + src_edge_counter = {} + dst_edge_counter = {} + for src, dst in EDGES: + src_edge_counter[src] = src_edge_counter.get(src, 0) + dst_edge_counter[dst] = dst_edge_counter.get(dst, 0) + src_seen = {k: 0 for k in src_edge_counter} + dst_seen = {k: 0 for k in dst_edge_counter} + src_labeled = set() + for src, dst in EDGES: + if src not in node_boxes or dst not in node_boxes: + continue + src_y_offset = src_seen[src] * int(4 * s) + dst_y_offset = 0 + src_seen[src] += 1 + dst_seen[dst] += 1 + points = route_arrow(node_boxes[src], node_boxes[dst], src_y_offset=src_y_offset, dst_y_offset=dst_y_offset) + arrow_color = action_colors.get(src, "#0066cc") + # Compute arrowhead geometry first so line ends exactly at arrowhead base. + x_dst, y_dst = points[-1] + x_prev, y_prev = points[-2] + angle = atan2(y_dst - y_prev, x_dst - x_prev) + arr_len = arrow_width * 6 + arr_w = arrow_width * 3 + xa = x_dst - arr_len * cos(angle) + ya = y_dst - arr_len * sin(angle) + perp_angle = angle + 3.14159 / 2 # perpendicular (90 degrees) to arrow direction + xbl = xa + arr_w * cos(perp_angle) + ybl = ya + arr_w * sin(perp_angle) + xbr = xa - arr_w * cos(perp_angle) + ybr = ya - arr_w * sin(perp_angle) + # Draw line segments; last segment stops at arrowhead base (xa, ya). + for i in range(len(points) - 1): + x0, y0 = points[i] + x1, y1 = points[i + 1] + if i == len(points) - 2: + x1, y1 = xa, ya + draw.line([(x0, y0), (x1, y1)], fill=arrow_color, width=arrow_width) + # Draw arrowhead on top to create clean connection. + draw.polygon([(x_dst, y_dst), (xbl, ybl), (xbr, ybr)], fill=arrow_color) + # Add edge label above the final horizontal segment — only once per source. + lbl = grid.get(src, {}).get("marker_label", "") + if lbl and src not in src_labeled: + lx = (points[2][0] + points[3][0]) / 2 + ly = points[2][1] - int(20 * s) + lbl_color = action_colors.get(src, "#1f4f7a") + draw_edge_label(lbl, lx, ly, lbl_color) + src_labeled.add(src) + + # Draw click markers last so they stay above screenshots and arrows. + for nid, (cx, cy) in click_points.items(): + draw_click_marker(nid, cx, cy) + + # ── Stacked action-flow frames ────────────────────────────────────────── + # Layout constants + outer_pad = int(34 * s) + section_gap = int(30 * s) + header_h = int(70 * s) + footer_h = int(18 * s) + inner_pad = int(34 * s) # inside each frame + frame_tag_h = int(56 * s) # frame title-bar height + cell_pad = int(20 * s) # gutter between grid-line and cell box + cell_tag_h = int(34 * s) # per-cell label bar height + img_pad = int(12 * s) # space between cell-box edge and screenshot + arrow_gap = int(40 * s) # horizontal gutter between columns for arrows + + # ONE global standard image width — every screenshot is scaled to exactly + # this many pixels wide; height follows the natural aspect ratio (no crop). + STANDARD_IMG_W = int(480 * s) + + # Pre-read native screenshot dimensions from disk + def _shot_orig(name): + p = SHOTS_DIR / name.replace(".html", ".png") + if not p.exists(): + return (1600, 900) + with Image.open(p) as im: + return im.size + + _orig = {pg: _shot_orig(pg) for pg in [ + "index.html", "busStop.html", "busDetail.html", "stopDetail.html", + "busDetailExpanded.html", "stopDetailExpanded.html", + ]} + + def _natural_h(page): + ow, oh = _orig.get(page, (1600, 900)) + return int(oh * STANDARD_IMG_W / ow) + + # ── Frame table definitions ───────────────────────────────────────────── + frame1_table = { + 'cols': [ + {'col': 0, 'rows': [ + {'id': 'I', 'page': 'index.html', 'label': 'index.html', 'show_marker': False, 'emphasis_start': True}, + ]}, + {'col': 1, 'rows': [ + {'id': 'IA', 'page': 'index.html', 'label': 'index.html (คลิก "ป้ายหยุดรถ")', 'show_marker': True}, + {'id': 'IB', 'page': 'index.html', 'label': 'index.html (คลิก "คลิกหมายเลขสาย 101")', 'show_marker': True}, + ]}, + {'col': 2, 'rows': [ + {'id': 'S', 'page': 'busStop.html', 'label': 'busStop.html', 'show_marker': False, 'emphasis_end': True}, + {'id': 'B', 'page': 'busDetail.html', 'label': 'busDetail.html', 'show_marker': False, 'emphasis_end': True}, + ]}, + ], + 'edges': [ + {'src': 'I', 'dst': 'IA', 'label': 'คลิก "ป้ายหยุดรถ"', 'color': '#2563eb'}, + {'src': 'I', 'dst': 'IB', 'label': 'คลิกหมายเลขสาย 101', 'color': '#2563eb'}, + {'src': 'IA', 'dst': 'S', 'label': 'ไป busStop', 'color': '#2563eb'}, + {'src': 'IB', 'dst': 'B', 'label': 'ไป busDetail', 'color': '#2563eb'}, + ], + } + frame2_table = { + 'cols': [ + {'col': 0, 'rows': [{'id': 'S', 'page': 'busStop.html', 'label': 'busStop.html', 'show_marker': False, 'emphasis_start': True}]}, + {'col': 1, 'rows': [{'id': 'SC', 'page': 'busStop.html', 'label': 'busStop.html (คลิก "บขส.อ่างทอง")', 'show_marker': True, 'marker_box_id': 'N3a'}]}, + {'col': 2, 'rows': [{'id': 'D', 'page': 'stopDetail.html', 'label': 'stopDetail.html', 'show_marker': False}]}, + {'col': 3, 'rows': [{'id': 'BE', 'page': 'busDetailExpanded.html','label': 'busDetail (expanded)', 'show_marker': True}]}, + {'col': 4, 'rows': [{'id': 'DE', 'page': 'stopDetailExpanded.html','label':'stopDetail (expanded)', 'show_marker': True}]}, + {'col': 5, 'rows': [{'id': 'B', 'page': 'busDetail.html', 'label': 'busDetail.html', 'show_marker': False, 'emphasis_end': True}]}, + ], + 'edges': [ + {'src': 'S', 'dst': 'SC', 'label': 'คลิก "บขส.อ่างทอง"', 'color': '#7c3aed'}, + {'src': 'SC', 'dst': 'D', 'label': 'ไป stopDetail', 'color': '#7c3aed'}, + {'src': 'D', 'dst': 'BE', 'label': 'ไป busDetail(exp)', 'color': '#7c3aed'}, + {'src': 'BE', 'dst': 'DE', 'label': 'ไป stopDetail(exp)', 'color': '#7c3aed'}, + {'src': 'DE', 'dst': 'B', 'label': 'สิ้นสุด busDetail', 'color': '#7c3aed'}, + ], + } + frame3_table = { + 'cols': [ + {'col': 0, 'rows': [{'id': 'B', 'page': 'busDetail.html', 'label': 'busDetail.html', 'show_marker': False, 'emphasis_start': True}]}, + {'col': 1, 'rows': [{'id': 'BE', 'page': 'busDetailExpanded.html', 'label': 'busDetail (expanded)', 'show_marker': True}]}, + {'col': 2, 'rows': [{'id': 'DE', 'page': 'stopDetailExpanded.html','label': 'stopDetail (expanded)', 'show_marker': True}]}, + {'col': 3, 'rows': [{'id': 'D', 'page': 'stopDetail.html', 'label': 'stopDetail.html', 'show_marker': False, 'emphasis_end': True}]}, + ], + 'edges': [ + {'src': 'B', 'dst': 'BE', 'label': 'ไป busDetail(exp)', 'color': '#0f766e'}, + {'src': 'BE', 'dst': 'DE', 'label': 'ไป stopDetail(exp)', 'color': '#0f766e'}, + {'src': 'DE', 'dst': 'D', 'label': 'สิ้นสุด stopDetail','color': '#0f766e'}, + ], + } + + FRAMES = [ + (frame1_table, "#2563eb", + "index.html action flow", + "start at index.html → busStop.html / busDetail.html"), + (frame2_table, "#7c3aed", + "busStop action flow", + "busStop → stopDetail → busDetail(exp) → stopDetail(exp) → busDetail"), + (frame3_table, "#0f766e", + "busDetail action flow", + "busDetail → busDetail(exp) → stopDetail(exp) → stopDetail"), + ] + + # Pages that are used as a flow start. Reuse the same "start signature" + # frame style whenever these pages appear in other flows. + START_SIGNATURE_PAGES = { + node['page'] + for table, *_ in FRAMES + for col in table['cols'] + for node in col['rows'] + if node.get('emphasis_start') + } + START_SIGNATURE_PAGE_TINT = { + node['page']: tint + for table, tint, *_ in FRAMES + for col in table['cols'] + for node in col['rows'] + if node.get('emphasis_start') + } + + # ── Dynamic layout computation ────────────────────────────────────────── + # cell content width: STANDARD_IMG_W + padding on both sides + cell_content_w = STANDARD_IMG_W + 2 * img_pad + # full column width (cell box + gutter) + col_slot_w = cell_content_w + 2 * cell_pad + arrow_gap + + def _row_img_heights(table): + """Per-row max natural image height at STANDARD_IMG_W.""" + cols = table['cols'] + max_rows = max(len(c['rows']) for c in cols) + heights = [] + for ri in range(max_rows): + mh = 0 + for c in cols: + if ri < len(c['rows']): + mh = max(mh, _natural_h(c['rows'][ri]['page'])) + heights.append(mh) + return heights + + def _frame_h(row_img_heights): + rows_total = sum( + cell_tag_h + 2 * img_pad + h + 2 * cell_pad + for h in row_img_heights + ) + return frame_tag_h + 2 * inner_pad + rows_total + + def _frame_content_w(table): + return len(table['cols']) * col_slot_w + + all_row_heights = [_row_img_heights(t) for t, *_ in FRAMES] + all_frame_h = [_frame_h(rh) for rh in all_row_heights] + + frame_w = max(_frame_content_w(t) for t, *_ in FRAMES) + 2 * inner_pad + frame_w = max(frame_w, int(2000 * s)) + + total_h = (outer_pad + header_h + + sum(all_frame_h) + + section_gap * (len(FRAMES) - 1) + + footer_h + outer_pad) + + final_img = Image.new("RGBA", (outer_pad * 2 + frame_w, total_h), "#f4f7ff") + final_draw = ImageDraw.Draw(final_img) + + # ── Helper functions ──────────────────────────────────────────────────── + def mix_rgb(c1, c2, t): + return ( + int(c1[0] + (c2[0] - c1[0]) * t), + int(c1[1] + (c2[1] - c1[1]) * t), + int(c1[2] + (c2[2] - c1[2]) * t), + ) + + def tint_towards_white(hex_color, strength): + base = hex_to_rgb(hex_color) + return mix_rgb(base, (255, 255, 255), strength) + + def draw_linear_gradient(rect, c1, c2, vertical=True): + x1, y1, x2, y2 = [int(v) for v in rect] + if vertical: + h = max(1, y2 - y1) + for i in range(h): + t = i / max(1, h - 1) + final_draw.line([(x1, y1 + i), (x2, y1 + i)], fill=mix_rgb(c1, c2, t)) + else: + w = max(1, x2 - x1) + for i in range(w): + t = i / max(1, w - 1) + final_draw.line([(x1 + i, y1), (x1 + i, y2)], fill=mix_rgb(c1, c2, t)) + + def draw_soft_rounded_gradient(rect, radius, c1, c2, outline=None, outline_w=1, vertical=True): + x1, y1, x2, y2 = [int(v) for v in rect] + w = max(1, x2 - x1) + h = max(1, y2 - y1) + grad = Image.new("RGBA", (w, h), (0, 0, 0, 0)) + gd = ImageDraw.Draw(grad) + if vertical: + for i in range(h): + t = i / max(1, h - 1) + gd.line([(0, i), (w, i)], fill=(*mix_rgb(c1, c2, t), 255)) + else: + for i in range(w): + t = i / max(1, w - 1) + gd.line([(i, 0), (i, h)], fill=(*mix_rgb(c1, c2, t), 255)) + mask = Image.new("L", (w, h), 0) + md = ImageDraw.Draw(mask) + md.rounded_rectangle([0, 0, w - 1, h - 1], radius=radius, fill=255) + final_img.paste(grad, (x1, y1), mask) + if outline: + final_draw.rounded_rectangle([x1, y1, x2, y2], radius=radius, outline=outline, width=outline_w) + + bg_c1 = (246, 248, 255) + bg_c2 = (237, 245, 255) + draw_linear_gradient([0, 0, final_img.width, final_img.height], bg_c1, bg_c2, vertical=True) + + def fit_shot_std(name): + """Scale screenshot to exactly STANDARD_IMG_W; height is natural (no crop).""" + p = SHOTS_DIR / name.replace(".html", ".png") + if not p.exists(): + return None + shot = Image.open(p).convert("RGB") + new_h = int(shot.height * STANDARD_IMG_W / shot.width) + return shot.resize((STANDARD_IMG_W, new_h), Image.Resampling.LANCZOS) + + def place_cell(col_x1, row_y1, page_name, label, tint, row_img_h, node_def=None, shared_start_pages=None, shared_start_tints=None): + """ + Draw one table cell: label bar + screenshot at STANDARD_IMG_W. + Cell is vertically centered inside a row band driven by row_img_h. + Returns both frame and screenshot bounds for downstream routing. + """ + cx1 = col_x1 + cell_pad + cx2 = cx1 + cell_content_w + + # Fit each frame to the actual image height so the border hugs the image. + shot = fit_shot_std(page_name) + content_h = shot.height if shot is not None else row_img_h + cell_h = cell_tag_h + 2 * img_pad + content_h + 2 * cell_pad + row_h = cell_tag_h + 2 * img_pad + row_img_h + 2 * cell_pad + cy1 = row_y1 + max(0, (row_h - cell_h) // 2) + cy2 = cy1 + cell_h + + # Determine emphasis state for highlight + is_emphasis_start = node_def and node_def.get('emphasis_start') + is_emphasis_end = node_def and node_def.get('emphasis_end') + has_click_marker = bool(node_def and node_def.get('show_marker')) + is_clean_node = not has_click_marker + is_shared_start_page = bool(shared_start_pages and page_name in shared_start_pages) + is_start_signature = bool((is_emphasis_start or is_shared_start_page) and is_clean_node) + + signature_tint = tint + if is_start_signature and shared_start_tints and page_name in shared_start_tints: + signature_tint = shared_start_tints[page_name] + + tint_rgb = hex_to_rgb(tint) + signature_tint_rgb = hex_to_rgb(signature_tint) + cell_top = tint_towards_white(tint, 0.94) + cell_bottom = tint_towards_white(tint, 0.88) + + # Start-signature redesign: stronger visual presence with an outer ring. + if is_start_signature: + ring_pad = int(10 * s) + ring_top = tint_towards_white(signature_tint, 0.84) + ring_bottom = tint_towards_white(signature_tint, 0.68) + draw_soft_rounded_gradient( + [cx1 - ring_pad, cy1 - ring_pad, cx2 + ring_pad, cy2 + ring_pad], + radius=int(18 * s), + c1=ring_top, + c2=ring_bottom, + outline=signature_tint, + outline_w=int(2 * s), + vertical=True, + ) + + cell_top = tint_towards_white(signature_tint, 0.90) + cell_bottom = tint_towards_white(signature_tint, 0.78) + + # Cell box with enhanced border for emphasized nodes + border_width = int(8 * s) if is_start_signature else (int(6 * s) if is_emphasis_end else int(3 * s)) + draw_soft_rounded_gradient( + [cx1, cy1, cx2, cy2], + radius=int(14 * s), + c1=cell_top, + c2=cell_bottom, + outline=signature_tint if is_start_signature else tint, + outline_w=border_width, + vertical=True, + ) + + if is_start_signature: + # Double-edge look for start frames to make them stand out from others. + inner_pad = int(8 * s) + final_draw.rounded_rectangle( + [cx1 + inner_pad, cy1 + inner_pad, cx2 - inner_pad, cy2 - inner_pad], + radius=int(10 * s), outline=signature_tint, width=int(2 * s) + ) + + # Label bar + bar_color_rgb = signature_tint_rgb if is_start_signature else tint_rgb + bar_top = mix_rgb(bar_color_rgb, (255, 255, 255), 0.12) if is_start_signature else mix_rgb(bar_color_rgb, (255, 255, 255), 0.22) + bar_bottom = mix_rgb(bar_color_rgb, (255, 255, 255), 0.02) if is_start_signature else mix_rgb(bar_color_rgb, (255, 255, 255), 0.08) + draw_soft_rounded_gradient( + [cx1, cy1, cx2, cy1 + cell_tag_h], + radius=int(12 * s), + c1=bar_top, + c2=bar_bottom, + outline=None, + vertical=True, + ) + final_draw.rectangle([cx1, cy1 + cell_tag_h - int(6 * s), cx2, cy1 + cell_tag_h], + fill=bar_bottom) + final_draw.text((cx1 + int(10 * s), cy1 + int(18 * s)), + label, fill="#ffffff", font=get_font(int(11 * s)), anchor="lm") + + # Screenshot — always STANDARD_IMG_W wide + ix = cx1 + img_pad + iy = cy1 + cell_tag_h + img_pad + if shot is not None: + final_img.paste(shot, (int(ix), int(iy))) + return { + "frame": (int(cx1), int(cy1), int(cx2), int(cy2)), + "image": (int(ix), int(iy), int(ix) + shot.width, int(iy) + shot.height), + } + else: + mx = (cx1 + cx2) // 2 + my = (cy1 + cy2) // 2 + final_draw.text((mx, my), page_name, fill="#64748b", + font=get_font(int(10 * s)), anchor="mm") + return { + "frame": (int(cx1), int(cy1), int(cx2), int(cy2)), + "image": (int(cx1), int(cy1), int(cx2), int(cy2)), + } + + def draw_frame_box(rect, title, subtitle, tint): + x1, y1, x2, y2 = rect + frame_top = tint_towards_white(tint, 0.96) + frame_bottom = tint_towards_white(tint, 0.90) + draw_soft_rounded_gradient( + [x1, y1, x2, y2], + radius=int(18 * s), + c1=frame_top, + c2=frame_bottom, + outline=tint, + outline_w=int(3 * s), + vertical=True, + ) + + bar_h = int(48 * s) + tint_rgb = hex_to_rgb(tint) + bar_top = mix_rgb(tint_rgb, (255, 255, 255), 0.20) + bar_bottom = mix_rgb(tint_rgb, (255, 255, 255), 0.04) + draw_soft_rounded_gradient( + [x1, y1, x2, y1 + bar_h], + radius=int(16 * s), + c1=bar_top, + c2=bar_bottom, + outline=None, + vertical=True, + ) + final_draw.rectangle([x1, y1 + bar_h - int(8 * s), x2, y1 + bar_h], fill=bar_bottom) + final_draw.text((x1 + int(12 * s), y1 + int(16 * s)), + title, fill="#ffffff", font=get_font(int(14 * s)), anchor="lm") + final_draw.text((x1 + int(12 * s), y1 + int(36 * s)), + subtitle, fill="#edf2ff", font=get_font(int(11 * s)), anchor="lm") + + def draw_arrow_with_label(sx, sy, dx, dy, label, color): + mid_x = sx + (dx - sx) * 0.45 + path = [(sx, sy), (mid_x, sy), (mid_x, dy), (dx, dy)] + for i in range(len(path) - 1): + final_draw.line([path[i], path[i + 1]], fill=color, width=int(4 * s)) + angle = atan2(dy - path[-2][1], dx - path[-2][0]) + aln, alw = int(16 * s), int(9 * s) + xa = dx - aln * cos(angle); ya = dy - aln * sin(angle) + perp = angle + 3.14159 / 2 + final_draw.polygon([(dx, dy), + (xa + alw * cos(perp), ya + alw * sin(perp)), + (xa - alw * cos(perp), ya - alw * sin(perp))], fill=color) + lx = (path[1][0] + path[2][0]) / 2 + ly = min(path[1][1], path[2][1]) - int(16 * s) + tw = final_draw.textlength(label, font=get_font(int(11 * s))) + final_draw.rounded_rectangle( + [lx - tw / 2 - int(10 * s), ly - int(17 * s), + lx + tw / 2 + int(10 * s), ly + int(6 * s)], + radius=int(8 * s), fill=color) + final_draw.text((lx, ly - int(4 * s)), label, + fill="#ffffff", font=get_font(int(11 * s)), anchor="mm") + + def render_frame(frame_rect, table, tint, row_img_heights): + fx1, fy1, fx2, fy2 = frame_rect + # Content area starts below frame title bar + cx1 = fx1 + inner_pad + cy1 = fy1 + frame_tag_h + inner_pad + + cols = table['cols'] + max_rows = max(len(c['rows']) for c in cols) + + # Build cumulative row y-positions + row_tops = [] + cy = cy1 + for rh in row_img_heights: + row_tops.append(cy) + cy += cell_tag_h + 2 * img_pad + rh + 2 * cell_pad + + node_boxes = {} + for col_idx, col in enumerate(cols): + col_x1 = cx1 + col_idx * col_slot_w + for row_idx, node in enumerate(col['rows']): + rh = row_img_heights[row_idx] + bbox = place_cell(col_x1, row_tops[row_idx], + node['page'], node['label'], tint, rh, node_def=node, + shared_start_pages=START_SIGNATURE_PAGES, + shared_start_tints=START_SIGNATURE_PAGE_TINT) + node_boxes[node['id']] = bbox + + if col_idx < len(cols) - 1: + sep_x = col_x1 + col_slot_w - arrow_gap // 2 + final_draw.line([sep_x, int(cy1), sep_x, int(cy)], + fill="#d1d5db", width=int(2 * s)) + + # Draw horizontal row separator before each row > 0 in this column + if row_idx > 0: + sep_y = row_tops[row_idx] + final_draw.line([col_x1, sep_y, col_x1 + col_slot_w, sep_y], + fill="#d1d5db", width=int(2 * s)) + + # Click markers + for node_id, bounds in node_boxes.items(): + node_def = next( + n for c in cols for n in c['rows'] if n['id'] == node_id) + if node_def.get('show_marker'): + bbox = bounds['image'] + cmx = int((bbox[0] + bbox[2]) / 2) + cmy = int((bbox[1] + bbox[3]) / 2) + + marker_box_id = node_def.get('marker_box_id') + if marker_box_id and marker_box_id in boxes: + mb = boxes[marker_box_id] + page_w = _orig.get(node_def['page'], (1600, 900))[0] + scale = (bbox[2] - bbox[0]) / page_w if page_w else 1 + cmx = int(bbox[0] + (mb['x'] + mb['width'] / 2) * scale) + cmy = int(bbox[1] + (mb['y'] + mb['height'] / 2) * scale) + + r, g, b = hex_to_rgb(tint) + draw_soft_gradient_circle(final_img, cmx, cmy, (r, g, b)) + draw_cursor_icon(final_img, cmx, cmy, tint, scale=1.38 * s) + + # Arrows + for edge in table['edges']: + src_bounds = node_boxes.get(edge['src']) + dst_bounds = node_boxes.get(edge['dst']) + if src_bounds is None or dst_bounds is None: + continue + src_frame = src_bounds['frame'] + dst_frame = dst_bounds['frame'] + dst_x = dst_frame[0] - int(6 * s) + draw_arrow_with_label( + src_frame[2], (src_frame[1] + src_frame[3]) / 2, + dst_x, (dst_frame[1] + dst_frame[3]) / 2, + edge['label'], edge['color']) + + # ── Compose canvas ────────────────────────────────────────────────────── + final_draw.text((outer_pad, outer_pad + int(18 * s)), + "AT Transit Action Flow (Stacked Frames)", + fill="#1f2a44", font=get_font(int(18 * s)), anchor="lm") + + cursor_y = outer_pad + header_h + for (table, tint, title, subtitle), rh_list, fh in zip(FRAMES, all_row_heights, all_frame_h): + frame_rect = (outer_pad, cursor_y, outer_pad + frame_w, cursor_y + fh) + draw_frame_box(frame_rect, title, subtitle, tint) + render_frame(frame_rect, table, tint, rh_list) + cursor_y += fh + section_gap + + final_img.convert("RGB").save(OUT_PNG) + print(f"saved {OUT_PNG}") + +if __name__ == "__main__": + print("Capturing screenshots...") + boxes, sizes = asyncio.run(capture_all()) + print(f"Composing diagram with {len(NODES)} nodes...") + compose(boxes, sizes) diff --git a/flow_ui/build_live_flow.py b/flow_ui/build_live_flow.py new file mode 100644 index 0000000..2c3ea75 --- /dev/null +++ b/flow_ui/build_live_flow.py @@ -0,0 +1,258 @@ +#!/usr/bin/env python3 +"""Capture the live web app and compose a flow UI diagram. + +Reads pages from http://localhost:13000 (override via FRONTEND_BASE env), +captures full-page screenshots, then composes a 2-row click-flow diagram: + + Row A (top, stop discovery): / → /stops → /stops/details?code= + Row B (bottom, route detail): / → /routes → /routes/ + +Includes the cross-flow action from the stop timetable back to route detail. + +The index node spans both rows. + +Outputs: + - flow_ui/frontend-web-transit-flow-live.png + - flow_ui/frontend-web-transit-flow-live.jpg +""" +import asyncio +import os +from pathlib import Path +from math import atan2, cos, sin, pi + +from PIL import Image, ImageDraw, ImageFont +from playwright.async_api import async_playwright + +Image.MAX_IMAGE_PIXELS = None + +ROOT = Path(__file__).resolve().parent +SHOTS_DIR = ROOT / "screenshots_live" +OUT_PNG = ROOT / "frontend-web-transit-flow-live.png" +OUT_JPG = ROOT / "frontend-web-transit-flow-live.jpg" + +BASE = os.environ.get("FRONTEND_BASE", "http://localhost:13000") +STOP_CODE = os.environ.get("STOP_CODE", "at_main_terminal") +ROUTE_ID = os.environ.get("ROUTE_ID", "101") + +VIEWPORT = {"width": 1440, "height": 900} +OUTPUT_SCALE = 2 # super-sample for crisp text + +# id, url_path, file_stem, col, row, span_rows, header_title, edge_label_in +NODES = [ + ("HOME", "/", "home", 0, 0, 2, "หน้าแรก · /", ""), + ("STOPS", "/stops", "stops", 1, 0, 1, "/stops · ค้นหาป้ายหยุดรถ", 'คลิก "ค้นหาป้ายหยุดรถ"'), + ("STOP", f"/stops/details?code={STOP_CODE}", "stop", 2, 0, 1, f"/stops/details?code={STOP_CODE} · รายละเอียดป้าย", "คลิกการ์ดป้ายแรก"), + ("ROUTES","/routes", "routes", 1, 1, 1, "/routes · รายการสายรถ", 'คลิก "รายละเอียดสายรถ"'), + ("ROUTE", f"/routes/{ROUTE_ID}", "route", 2, 1, 1, f"/routes/{ROUTE_ID} · รายละเอียดสาย", "คลิกการ์ดสายรถ"), +] + +EDGES = [ + ("HOME", "STOPS"), + ("STOPS", "STOP"), + ("HOME", "ROUTES"), + ("ROUTES", "ROUTE"), + ("STOP", "ROUTE"), +] + +COLORS = { + "HOME": "#0f766e", + "STOPS": "#2563eb", + "STOP": "#7c3aed", + "ROUTES": "#ea580c", + "ROUTE": "#db2777", +} + + +async def capture_all(): + SHOTS_DIR.mkdir(parents=True, exist_ok=True) + sizes = {} + async with async_playwright() as p: + browser = await p.chromium.launch() + ctx = await browser.new_context(viewport=VIEWPORT, device_scale_factor=1) + page = await ctx.new_page() + for nid, path, stem, *_ in NODES: + url = f"{BASE}{path}" + try: + await page.goto(url, wait_until="networkidle", timeout=20000) + except Exception as e: + print(f"WARN load {url}: {e}") + await page.goto(url, wait_until="domcontentloaded", timeout=20000) + await page.wait_for_timeout(600) + doc = await page.evaluate( + "({w: document.documentElement.scrollWidth, h: document.documentElement.scrollHeight})" + ) + sizes[nid] = (doc["w"], doc["h"]) + out = SHOTS_DIR / f"{stem}.png" + await page.screenshot(path=str(out), full_page=True) + print(f"captured {nid:6s} {url} {sizes[nid]}") + await browser.close() + return sizes + + +def get_font(size): + for path in [ + "/System/Library/Fonts/Supplemental/Arial Unicode.ttf", + "/System/Library/Fonts/Supplemental/Tahoma.ttf", + ]: + try: + return ImageFont.truetype(path, size) + except Exception: + continue + return ImageFont.load_default() + + +def compose(sizes): + s = OUTPUT_SCALE + cell_w = int(720 * s) + gutter_h = int(320 * s) + row_gap = int(180 * s) + margin_h = int(60 * s) + margin_v = int(70 * s) + header_h = int(54 * s) + title_h = int(70 * s) + px_per_col = cell_w + gutter_h + + # Scaled per-node size (cell_w wide, proportional height) + scaled = {} + for nid, *_ in NODES: + ow, oh = sizes.get(nid, (1440, 900)) + sw = cell_w + sh = int(oh * (cell_w / ow)) + scaled[nid] = (sw, sh) + + rows = sorted({n[4] for n in NODES}) + # Per-row band height = tallest non-spanning node in that row + row_band = {} + for r in rows: + candidates = [scaled[n[0]][1] for n in NODES if n[4] == r and n[5] == 1] + row_band[r] = max(candidates) if candidates else 800 + row_tops = {} + y = margin_v + title_h + for r in rows: + row_tops[r] = y + y += header_h + row_band[r] + row_gap + canvas_h = y + margin_v + max_col = max(n[3] for n in NODES) + canvas_w = margin_h * 2 + (max_col + 1) * cell_w + max_col * gutter_h + + img = Image.new("RGB", (canvas_w, canvas_h), "#f7f8fb") + draw = ImageDraw.Draw(img) + + font_title = get_font(int(28 * s)) + font_header = get_font(int(15 * s)) + font_label = get_font(int(15 * s)) + + # Diagram title + draw.text((margin_h, int(margin_v * 0.45)), + "AT Transit · Web UI Flow (live)", + fill="#0f172a", font=font_title) + sub = f"Captured from {BASE} · stop={STOP_CODE} · route={ROUTE_ID}" + draw.text((margin_h, int(margin_v * 0.45) + int(36 * s)), + sub, fill="#475569", font=font_header) + + boxes = {} + for nid, path, stem, col, row, span, header, edge_label in NODES: + png_path = SHOTS_DIR / f"{stem}.png" + if not png_path.exists(): + print(f"WARN no screenshot {png_path}") + continue + sw, sh = scaled[nid] + px = margin_h + col * (cell_w + gutter_h) + + if span > 1: + # Span across the listed rows: vertical center the panel across the bands + spanned = rows[:span] if rows[0] == row else rows[row:row+span] + band_top = row_tops[spanned[0]] + band_bot = row_tops[spanned[-1]] + header_h + row_band[spanned[-1]] + avail = band_bot - band_top - header_h + py = band_top + header_h + max(0, (avail - sh) // 2) + else: + py = row_tops[row] + header_h + max(0, (row_band[row] - sh) // 2) + + # Header bar + color = COLORS.get(nid, "#1f4f7a") + draw.rectangle([px, py - header_h, px + sw, py], fill=color) + draw.text((px + int(14 * s), py - header_h + int(14 * s)), + header, fill="#ffffff", font=font_header) + draw.text((px + int(14 * s), py - header_h + int(34 * s)), + path, fill="#e2e8f0", font=font_label) + + # Screenshot with subtle border + ss = Image.open(png_path).convert("RGB").resize((sw, sh), Image.Resampling.LANCZOS) + img.paste(ss, (px, py)) + draw.rectangle([px, py, px + sw - 1, py + sh - 1], outline="#cbd5e1", width=max(1, int(1.5 * s))) + boxes[nid] = (px, py - header_h, px + sw, py + sh) + + # Edges (orthogonal with arrowhead + pill label) + arrow_w = max(3, int(4 * s)) + + def pill(x, y, text, color): + f = get_font(int(15 * s)) + tw = draw.textlength(text, font=f) + th = int(20 * s) + pad_x, pad_y = int(14 * s), int(7 * s) + x1, y1 = x - tw / 2 - pad_x, y - th / 2 - pad_y + x2, y2 = x + tw / 2 + pad_x, y + th / 2 + pad_y + draw.rounded_rectangle([x1, y1, x2, y2], radius=int(10 * s), + fill=color, outline="#ffffff", width=max(1, int(2 * s))) + draw.text((x, y), text, fill="#ffffff", font=f, anchor="mm") + + src_offset = {n[0]: 0 for n in NODES} + label_for = {n[0]: n[7] for n in NODES} + + for src, dst in EDGES: + if src not in boxes or dst not in boxes: + continue + sx1, sy1, sx2, sy2 = boxes[src] + dx1, dy1, dx2, dy2 = boxes[dst] + # vertical anchor: row center of node body (excluding header) + s_cy = (sy1 + header_h + sy2) / 2 + src_offset[src] * int(28 * s) + d_cy = (dy1 + header_h + dy2) / 2 + src_offset[src] += 1 + + x_start = sx2 + x_end = dx1 + x_mid = x_start + (x_end - x_start) * 0.5 + + pts = [(x_start, s_cy), (x_mid, s_cy), (x_mid, d_cy), (x_end, d_cy)] + # arrowhead + ax, ay = pts[-1] + bx, by = pts[-2] + ang = atan2(ay - by, ax - bx) + head_len = arrow_w * 5 + head_w = arrow_w * 3 + hx = ax - head_len * cos(ang) + hy = ay - head_len * sin(ang) + perp = ang + pi / 2 + lx, ly = hx + head_w * cos(perp), hy + head_w * sin(perp) + rx, ry = hx - head_w * cos(perp), hy - head_w * sin(perp) + + color = COLORS.get(dst, "#0066cc") + # draw line segments, last one stops at head base + for i in range(len(pts) - 1): + x0, y0 = pts[i] + x1, y1 = pts[i + 1] + if i == len(pts) - 2: + x1, y1 = hx, hy + draw.line([(x0, y0), (x1, y1)], fill=color, width=arrow_w) + draw.polygon([(ax, ay), (lx, ly), (rx, ry)], fill=color) + + lbl = label_for.get(dst, "") + if lbl: + mid_x = (pts[1][0] + pts[2][0]) / 2 + mid_y = (pts[1][1] + pts[2][1]) / 2 + pill(mid_x, mid_y, lbl, color) + + img.save(OUT_PNG, "PNG", optimize=True) + img.save(OUT_JPG, "JPEG", quality=88, optimize=True, progressive=True) + print(f"\nwrote {OUT_PNG} ({img.size[0]}x{img.size[1]}px)") + print(f"wrote {OUT_JPG} ({img.size[0]}x{img.size[1]}px)") + + +async def main(): + sizes = await capture_all() + compose(sizes) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/flow_ui/data/provinces.json b/flow_ui/data/provinces.json new file mode 100644 index 0000000..673d4d2 --- /dev/null +++ b/flow_ui/data/provinces.json @@ -0,0 +1,13 @@ +{ + "provinces": [ + { "province_id": 1, "province_name_th": "อ่างทอง" }, + { "province_id": 2, "province_name_th": "อยุธยา" }, + { "province_id": 3, "province_name_th": "ปทุมธานี" }, + { "province_id": 4, "province_name_th": "กรุงเทพมหานคร" }, + { "province_id": 5, "province_name_th": "สุพรรณบุรี" }, + { "province_id": 6, "province_name_th": "สระบุรี" }, + { "province_id": 7, "province_name_th": "ลพบุรี" }, + { "province_id": 8, "province_name_th": "สิงห์บุรี" }, + { "province_id": 9, "province_name_th": "ชัยนาท" } + ] +} diff --git a/flow_ui/data/route_groups.json b/flow_ui/data/route_groups.json new file mode 100644 index 0000000..966889a --- /dev/null +++ b/flow_ui/data/route_groups.json @@ -0,0 +1,32 @@ +{ + "route_groups": [ + { + "route_group": "municipal", + "route_group_id": 1, + "route_group_label": "หมวดเส้นทางภายในเทศบาล", + "display_order": 1, + "is_active": true + }, + { + "route_group": "bangkok", + "route_group_id": 2, + "route_group_label": "หมวดเส้นทางเข้ากรุงเทพฯ", + "display_order": 2, + "is_active": true + }, + { + "route_group": "interprovincial", + "route_group_id": 3, + "route_group_label": "หมวดเส้นทางระหว่างจังหวัด", + "display_order": 3, + "is_active": true + }, + { + "route_group": "in_province", + "route_group_id": 4, + "route_group_label": "หมวดเส้นทางภายในจังหวัด", + "display_order": 4, + "is_active": true + } + ] +} diff --git a/flow_ui/data/routes.json b/flow_ui/data/routes.json new file mode 100644 index 0000000..25fc699 --- /dev/null +++ b/flow_ui/data/routes.json @@ -0,0 +1,158 @@ +{ + "routes": [ + { + "route_id": "902", + "route_name_th": "กรุงเทพ-อ่างทอง สายเอเซีย", + "vehicle_type": "bus", + "route_group": "bangkok", + "route_group_id": 2, + "province_ids": [1, 2, 3, 4], + "phone": ["+6684 337 7376", "+6662 381 5828"], + "web_url": "https://www.facebook.com/profile.php?id=100063523693753", + "station_ids": [1, 5, 6] + }, + { + "route_id": "15", + "route_name_th": "กรุงเทพ-อ่างทอง สายใน", + "vehicle_type": "bus", + "route_group": "bangkok", + "route_group_id": 2, + "province_ids": [1, 2, 3, 4], + "phone": ["+6693 249 5788"], + "web_url": "https://www.facebook.com/groups/1355821444815052", + "station_ids": [1, 2, 4, 5, 6] + }, + { + "route_id": "951", + "route_name_th": "กรุงเทพ-วิเศษ-สุพรรณ", + "vehicle_type": "van", + "route_group": "bangkok", + "route_group_id": 2, + "province_ids": [1, 5, 4], + "phone": ["+6686 099 4250"], + "web_url": "https://www.facebook.com/groups/1323166441639529", + "station_ids": [9, 5, 6, 8] + }, + { + "route_id": "952", + "route_name_th": "กรุงเทพ-วิเศษชัยชาญ", + "vehicle_type": "van", + "route_group": "bangkok", + "route_group_id": 2, + "province_ids": [1, 4], + "phone": ["+6664 238 8698"], + "web_url": null, + "station_ids": [11, 12, 8] + }, + { + "route_id": "954", + "route_name_th": "กรุงเทพ-ท่าช้าง", + "vehicle_type": "van", + "route_group": "bangkok", + "route_group_id": 2, + "province_ids": [1, 2, 3, 4, 5], + "phone": ["+6690 140 3636"], + "web_url": "https://shorturl.asia/Qe0s3", + "station_ids": [5, 6, 8] + }, + { + "route_id": "8", + "route_name_th": "กรุงเทพ-สรรคบุรี-ชัยนาท", + "vehicle_type": "van", + "route_group": "bangkok", + "route_group_id": 2, + "province_ids": [1, 2, 3, 4, 8, 9], + "phone": ["+6656-412264", "+6686-4491276", "+6688-2716613"], + "web_url": "https://linevoom.line.me/user/_ddH8YAybarByo7eVApp-6f0teYGaM0bXI4CLBhE", + "station_ids": [5, 6, 8, 13] + }, + { + "route_id": "101", + "route_name_th": "อ่างทอง-ป่าโมก-อยุธยา", + "vehicle_type": "bus", + "route_group": "interprovincial", + "route_group_id": 3, + "province_ids": [1, 2], + "phone": ["+6664 963 9025"], + "web_url": null, + "station_ids": [1, 2, 3, 4] + }, + { + "route_id": "464", + "route_name_th": "สุพรรณ-อ่างทอง-สระบุรี", + "vehicle_type": "bus", + "route_group": "interprovincial", + "route_group_id": 3, + "province_ids": [1, 2, 5, 6], + "phone": ["+6699 039 3343", "+6692 482 4781"], + "web_url": "https://line.me/ti/g2/tXBwCvja_Ign9PlboFugqx_NJWbxVb31J1TSMQ", + "station_ids": [1, 9, 10] + }, + { + "route_id": "641", + "route_name_th": "อ่างทอง-บ้านแพรก-ลพบุรี", + "vehicle_type": "bus", + "route_group": "interprovincial", + "route_group_id": 3, + "province_ids": [1, 2, 7], + "phone": ["+6689 084 2136"], + "web_url": null, + "station_ids": [1, 7, 8] + }, + { + "route_id": "2194", + "route_name_th": "หัวเวียง-อยุธยา", + "vehicle_type": "van", + "route_group": "interprovincial", + "route_group_id": 3, + "province_ids": [2], + "phone": [], + "web_url": null, + "station_ids": [4, 8] + }, + { + "route_id": "324", + "route_name_th": "อ่างทอง-วัดพิกุลทอง", + "vehicle_type": "bus", + "route_group": "in_province", + "route_group_id": 4, + "province_ids": [1], + "phone": [], + "web_url": null, + "station_ids": [1, 8] + }, + { + "route_id": "1011", + "route_name_th": "อ่างทอง-สีบัวทอง", + "vehicle_type": "bus", + "route_group": "in_province", + "route_group_id": 4, + "province_ids": [1], + "phone": ["+6695 962 3008", "+6661 431 2399"], + "web_url": null, + "station_ids": [1, 8] + }, + { + "route_id": "2231", + "route_name_th": "อ่างทอง-มหานาม", + "vehicle_type": "van", + "route_group": "in_province", + "route_group_id": 4, + "province_ids": [1], + "phone": [], + "web_url": null, + "station_ids": [1] + }, + { + "route_id": "999", + "route_name_th": "บริษัท ขนส่ง จำกัด (บขส.อ่างทอง)", + "vehicle_type": "bus", + "route_group": "in_province", + "route_group_id": 4, + "province_ids": [1], + "phone": ["0-3561-1344"], + "web_url": "999.html", + "station_ids": [14] + } + ] +} \ No newline at end of file diff --git a/flow_ui/data/schedules.json b/flow_ui/data/schedules.json new file mode 100644 index 0000000..a23d664 --- /dev/null +++ b/flow_ui/data/schedules.json @@ -0,0 +1,244 @@ +{ + "schedules": [ + { + "schedule_id": 1, + "route_id": "101", + "station_id": 4, + "direction_note": null, + "departure_times": ["06:30", "07:20", "08:10", "09:00", "09:50", "10:40", "11:30", "12:20", "13:10", "14:00", "14:50", "15:40", "16:30", "17:30"], + "schedule_note": null + }, + { + "schedule_id": 2, + "route_id": "101", + "station_id": 1, + "direction_note": null, + "departure_times": ["07:30", "08:20", "09:10", "10:00", "10:50", "11:50", "13:00", "14:00", "15:00"], + "schedule_note": null + }, + { + "schedule_id": 3, + "route_id": "101", + "station_id": 2, + "direction_note": "ไปอ่างทอง", + "departure_times": ["07:30", "08:20", "09:10", "10:00", "10:50", "11:40", "12:30", "13:20", "14:10", "15:00", "15:50", "16:40", "17:30", "18:30"], + "schedule_note": null + }, + { + "schedule_id": 4, + "route_id": "101", + "station_id": 2, + "direction_note": "ไปอยุธยา", + "departure_times": ["08:00", "08:50", "09:40", "10:30", "11:20", "12:20", "13:30", "14:30", "15:30"], + "schedule_note": "เวลารถเปลี่ยนทุกวัน โดยเฉพาะวันหยุด" + }, + { + "schedule_id": 5, + "route_id": "15", + "station_id": 1, + "direction_note": null, + "departure_times": ["05:00", "05:45", "06:30", "07:30"], + "schedule_note": null + }, + { + "schedule_id": 6, + "route_id": "15", + "station_id": 2, + "direction_note": null, + "departure_times": ["05:30", "06:20", "07:05", "07:55", "08:40", "09:30", "11:20", "12:10", "13:00", "15:00"], + "schedule_note": null + }, + { + "schedule_id": 7, + "route_id": "15", + "station_id": 6, + "direction_note": null, + "departure_times": ["06:00", "08:30", "09:15", "10:00", "12:30", "14:00", "15:00", "16:00"], + "schedule_note": "เวลารถเปลี่ยนทุกวัน" + }, + { + "schedule_id": 8, + "route_id": "902", + "station_id": 1, + "direction_note": null, + "departure_times": ["04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30"], + "schedule_note": null + }, + { + "schedule_id": 9, + "route_id": "902", + "station_id": 6, + "direction_note": null, + "departure_times": ["06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00"], + "schedule_note": null + }, + { + "schedule_id": 10, + "route_id": "951", + "station_id": 9, + "direction_note": null, + "departure_times": ["04:00", "04:20", "04:40", "05:00", "05:20", "05:40", "06:00", "06:20", "06:40", "07:00", "07:20", "07:40", "08:00", "08:20", "08:40", "09:00", "09:20", "09:40", "10:00", "10:20", "10:40", "11:00", "11:20", "11:40", "12:00", "12:20", "12:40", "13:00", "13:20", "13:40", "14:00", "14:20", "14:40", "15:00", "15:20", "15:40", "16:00", "16:20", "16:40", "17:00", "17:20", "17:40", "18:00"], + "schedule_note": null + }, + { + "schedule_id": 11, + "route_id": "952", + "station_id": 8, + "direction_note": "จากตลาดวิเศษ", + "departure_times": ["04:30", "10:00", "15:00"], + "schedule_note": null + }, + { + "schedule_id": 12, + "route_id": "952", + "station_id": 12, + "direction_note": null, + "departure_times": ["07:00", "10:30", "15:00"], + "schedule_note": "10:30 และ 7:00 มีเฉพาะวันหยุด" + }, + { + "schedule_id": 13, + "route_id": "954", + "station_id": 8, + "direction_note": "จากท่าช้าง", + "departure_times": ["08:00"], + "schedule_note": "เวลาเปลี่ยนทุกวัน" + }, + { + "schedule_id": 14, + "route_id": "8", + "station_id": 13, + "direction_note": null, + "departure_times": ["03:30", "04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "11:00", "12:00", "13:00", "14:00", "15:00", "17:00"], + "schedule_note": null + }, + { + "schedule_id": 15, + "route_id": "8", + "station_id": 8, + "direction_note": "จากโพธิ์ทอง", + "departure_times": ["05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "12:30", "13:30", "14:30", "15:30", "16:30", "18:30"], + "schedule_note": "เวลาเปลี่ยนทุกวัน" + }, + { + "schedule_id": 16, + "route_id": "464", + "station_id": 9, + "direction_note": null, + "departure_times": ["04:40", "05:10", "05:40", "06:10", "06:40", "07:10", "07:40", "08:15", "08:50", "09:25", "10:00", "10:35", "11:10", "11:45", "12:20", "12:55", "13:30", "14:05", "14:40", "15:15", "15:50", "16:25", "17:00", "17:40"], + "schedule_note": null + }, + { + "schedule_id": 17, + "route_id": "464", + "station_id": 10, + "direction_note": null, + "departure_times": ["05:00", "05:40", "06:20", "07:10", "08:00", "08:40", "09:20", "10:00", "10:40", "11:20", "12:00", "12:40", "13:20", "14:00", "14:40", "15:20", "16:00", "16:40", "17:20", "18:00"], + "schedule_note": null + }, + { + "schedule_id": 18, + "route_id": "464", + "station_id": 1, + "direction_note": "ไปสุพรรณบุรี", + "departure_times": ["06:30", "07:10", "07:50", "08:40", "09:30", "10:10", "10:50", "11:30", "12:10", "12:50", "13:30", "14:10", "14:50", "15:30", "16:10", "16:50", "17:30", "18:10", "18:50", "19:30"], + "schedule_note": null + }, + { + "schedule_id": 19, + "route_id": "464", + "station_id": 1, + "direction_note": "ไปสระบุรี", + "departure_times": ["05:40", "06:10", "06:40", "07:10", "07:40", "08:10", "08:40", "09:15", "09:50", "10:25", "11:00", "11:35", "12:10", "12:45", "13:20", "13:55", "14:30", "15:05", "15:40", "16:15", "16:50", "17:25", "18:00", "18:40"], + "schedule_note": "เวลารถเปลี่ยนทุกวัน" + }, + { + "schedule_id": 20, + "route_id": "641", + "station_id": 1, + "direction_note": null, + "departure_times": ["07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:30", "14:30", "16:30"], + "schedule_note": null + }, + { + "schedule_id": 21, + "route_id": "641", + "station_id": 7, + "direction_note": null, + "departure_times": ["07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:30", "14:30", "16:30"], + "schedule_note": "10:00 และ 13:30 ไม่ได้มีทุกวัน" + }, + { + "schedule_id": 22, + "route_id": "2194", + "station_id": 8, + "direction_note": "จากวัดหัวเวียง", + "departure_times": ["05:00", "06:00", "07:00"], + "schedule_note": null + }, + { + "schedule_id": 23, + "route_id": "2194", + "station_id": 4, + "direction_note": null, + "departure_times": ["16:00", "17:00", "18:00"], + "schedule_note": null + }, + { + "schedule_id": 24, + "route_id": "324", + "station_id": 1, + "direction_note": null, + "departure_times": ["10:00"], + "schedule_note": null + }, + { + "schedule_id": 25, + "route_id": "324", + "station_id": 8, + "direction_note": "จากวัดไชโยวรวิหาร", + "departure_times": ["08:00"], + "schedule_note": null + }, + { + "schedule_id": 26, + "route_id": "1011", + "station_id": 1, + "direction_note": null, + "departure_times": ["12:00", "16:00", "17:00"], + "schedule_note": null + }, + { + "schedule_id": 27, + "route_id": "1011", + "station_id": 8, + "direction_note": "จากวัดสีบัวทอง", + "departure_times": ["06:00", "06:30", "14:30"], + "schedule_note": null + }, + { + "schedule_id": 28, + "route_id": "2231", + "station_id": 1, + "direction_note": null, + "departure_times": ["16:00"], + "schedule_note": null + }, + { + "schedule_id": 29, + "route_id": "2231", + "station_id": 8, + "direction_note": "จากวัดมหานาม", + "departure_times": ["08:00"], + "schedule_note": null + }, + { + "schedule_id": 30, + "route_id": "999", + "station_id": 14, + "direction_note": null, + "departure_times": [], + "schedule_note": "ยังไม่มีข้อมูลตารางเวลา" + } + ] +} \ No newline at end of file diff --git a/flow_ui/data/stations.json b/flow_ui/data/stations.json new file mode 100644 index 0000000..7881bcc --- /dev/null +++ b/flow_ui/data/stations.json @@ -0,0 +1,156 @@ +{ + "stations": [ + { + "station_id": 1, + "station_code": "at_main_terminal", + "station_name_th": "บขส.อ่างทอง", + "city_th": "เมืองอ่างทอง", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + }, + { + "station_id": 2, + "station_code": "pa_mok_terminal", + "station_name_th": "สถานีขนส่งป่าโมก", + "city_th": "ป่าโมก", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + }, + { + "station_id": 3, + "station_code": "route_101_stop_ayutthaya", + "station_name_th": "จุดขึ้นลงรถสองแถว 101 อยุธยา-ป่าโมก-อ่างทอง", + "city_th": "พระนครศรีอยุธยา", + "province_th": "อยุธยา", + "station_type": "local_stop" + }, + { + "station_id": 4, + "station_code": "jaoprom_market", + "station_name_th": "ตลาดเจ้าพรหม", + "city_th": "พระนครศรีอยุธยา", + "province_th": "อยุธยา", + "station_type": "market" + }, + { + "station_id": 5, + "station_code": "rangsit_van_terminal", + "station_name_th": "ท่ารถตู้ต่างจังหวัด รังสิต", + "city_th": "รังสิต", + "province_th": "ปทุมธานี", + "station_type": "van_terminal" + }, + { + "station_id": 6, + "station_code": "chatuchak_minibus_terminal", + "station_name_th": "สถานีเดินรถโดยสารขนาดเล็ก (จตุจักร) รถตู้/มินิบัส", + "city_th": "จตุจักร", + "province_th": "กรุงเทพมหานคร", + "station_type": "van_terminal" + }, + { + "station_id": 7, + "station_code": "lopburi_main_terminal", + "station_name_th": "บขส.ลพบุรี", + "city_th": "เมืองลพบุรี", + "province_th": "ลพบุรี", + "station_type": "main_terminal" + }, + { + "station_id": 8, + "station_code": "other_stop", + "station_name_th": "จุดขึ้นรถประจำทางอื่นๆ", + "city_th": null, + "province_th": null, + "station_type": "local_stop" + }, + { + "station_id": 9, + "station_code": "suphan_main_terminal", + "station_name_th": "บขส.สุพรรณบุรี", + "city_th": "เมืองสุพรรณบุรี", + "province_th": "สุพรรณบุรี", + "station_type": "main_terminal" + }, + { + "station_id": 10, + "station_code": "saraburi_main_terminal", + "station_name_th": "บขส.สระบุรี", + "city_th": "เมืองสระบุรี", + "province_th": "สระบุรี", + "station_type": "main_terminal" + }, + { + "station_id": 11, + "station_code": "namo_supermarket", + "station_name_th": "นะโมซุปเปอร์มาร์ท", + "city_th": "วิเศษชัยชาญ", + "province_th": "อ่างทอง", + "station_type": "private_stop" + }, + { + "station_id": 12, + "station_code": "pinklao_van_stop", + "station_name_th": "สายใต้เก่า ปิ่นเกล้า จุดจอดรถตู้", + "city_th": "บางกอกน้อย", + "province_th": "กรุงเทพมหานคร", + "station_type": "van_terminal" + }, + { + "station_id": 13, + "station_code": "chainat_main_terminal", + "station_name_th": "บขส.ชัยนาท", + "city_th": "เมืองชัยนาท", + "province_th": "ชัยนาท", + "station_type": "main_terminal" + }, + { + "station_id": 14, + "station_code": "at_999_terminal", + "station_name_th": "บขส.999 อ่างทอง สายเอเชีย-เหนือ (ไม่เข้าเมือง)", + "city_th": "เมืองอ่างทอง", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + }, + { + "station_id": 15, + "station_code": "chaiyo_terminal", + "station_name_th": "สถานีขนส่งไชโย", + "city_th": "ไชโย", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + }, + { + "station_id": 16, + "station_code": "pho_thong_terminal", + "station_name_th": "สถานีขนส่งโพธิ์ทอง", + "city_th": "โพธิ์ทอง", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + }, + { + "station_id": 17, + "station_code": "sawaeng_ha_terminal", + "station_name_th": "สถานีขนส่งแสวงหา", + "city_th": "แสวงหา", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + }, + { + "station_id": 18, + "station_code": "wiset_chai_chan_terminal", + "station_name_th": "สถานีขนส่งวิเศษชัยชาญ", + "city_th": "วิเศษชัยชาญ", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + }, + { + "station_id": 19, + "station_code": "samko_terminal", + "station_name_th": "สถานีขนส่งสามโก้", + "city_th": "สามโก้", + "province_th": "อ่างทอง", + "station_type": "main_terminal" + } + ] +} diff --git a/flow_ui/flow-summary.md b/flow_ui/flow-summary.md new file mode 100644 index 0000000..f3c8f38 --- /dev/null +++ b/flow_ui/flow-summary.md @@ -0,0 +1,36 @@ +# Frontend Web Transit Flow Summary + +## Diagram +- File: flow_ui/frontend-web-transit-flow-live.png +- Alternate export: flow_ui/frontend-web-transit-flow-live.jpg +- Generated by: flow_ui/build_live_flow.py + +## Coverage +- Total pages covered: 5 +- Total key actions mapped: 5 +- Total visual states captured: 5 + +## Pages Included +- / +- /stops +- /stops/details?code=at_main_terminal +- /routes +- /routes/101 + +## Key Actions Mapped +- HOME -> STOPS: click "ค้นหาป้ายหยุดรถ" +- STOPS -> STOP: click a stop card from the stop directory +- HOME -> ROUTES: click "รายละเอียดสายรถ" +- ROUTES -> ROUTE: click a route card from the route directory +- STOP -> ROUTE: click route number inside the stop timetable card + +## Layout Notes +- The home page spans both rows so stop discovery and route discovery remain visually connected. +- The top row captures stop discovery ending at the new query-based details page. +- The bottom row captures route discovery ending at the merged route detail page. +- The cross-link from stop timetable to route detail documents the updated user journey after route cards were removed from stop details. + +## Assumptions +- The sample stop code remains `at_main_terminal` and sample route remains `101` unless overridden by environment variables. +- The legacy pages `/stops/` and `/routes//expanded` are now compatibility paths and are intentionally excluded from the primary flow diagram. +- The live capture uses the running frontend at `FRONTEND_BASE` and reflects current backend data. diff --git a/flow_ui/flow_overview.html b/flow_ui/flow_overview.html new file mode 100644 index 0000000..4331c47 --- /dev/null +++ b/flow_ui/flow_overview.html @@ -0,0 +1,253 @@ + + + + +AT Transit Action Flow (Stacked Frames) + + + + +
AT Transit Action Flow (Stacked Frames) — สไตล์ example-ui
+ +
+
+

index.html action flow

+

start at index.html → busStop.html / busDetail.html

+
+ +
+
+
index.html
+ +
+
+
คลิก "ป้ายหยุดรถ"
+ +
+
+
index.html (คลิก "ป้ายหยุดรถ")
+ +
+
+
+
ไป busStop
+ +
+
+
busStop.html
+ +
+
+ +
+
+
index.html (คลิก "หมายเลข 101")
+ +
+
+
+
ไป busDetail
+ +
+
+
busDetail.html
+ +
+
+
+ +
+
+

busStop action flow

+

busStop.html → stopDetail.html → busDetail (expanded) → stopDetail (expanded) → busDetail.html

+
+
+
+
busStop.html
+ +
+
+
คลิก "ป้ายมหาดไทย"
+ +
+
+
busStop.html (คลิก "ป้าย")
+ +
+
+
+
ไป stopDetail
+ +
+
+
stopDetail.html
+ +
+
+
ไป busDetail (exp)
+ +
+
+
busDetail (expanded)
+ +
+
+
+
ไป stopDetail (exp)
+ +
+
+
stopDetail (expanded)
+ +
+
+
+
ย้อนสู่ busDetail
+ +
+
+
busDetail.html
+ +
+
+
+ +
+
+

busDetail action flow

+

busDetail.html → busDetail (exp) → stopDetail (exp) → stopDetail.html

+
+
+
+
busDetail.html
+ +
+
+
ไป busDetail (exp)
+ +
+
+
busDetail (expanded)
+ +
+
+
ไป stopDetail (exp)
+ +
+
+
stopDetail (expanded)
+ +
+
+
+
ย้อนสู่ stopDetail
+ +
+
+
stopDetail.html
+ +
+
+
+ + + diff --git a/flow_ui/frontend-web-transit-flow-live.jpg b/flow_ui/frontend-web-transit-flow-live.jpg new file mode 100644 index 0000000..2719554 Binary files /dev/null and b/flow_ui/frontend-web-transit-flow-live.jpg differ diff --git a/flow_ui/frontend-web-transit-flow-live.png b/flow_ui/frontend-web-transit-flow-live.png new file mode 100644 index 0000000..b208e64 Binary files /dev/null and b/flow_ui/frontend-web-transit-flow-live.png differ diff --git a/flow_ui/frontend-web-transit-flow.png b/flow_ui/frontend-web-transit-flow.png new file mode 100644 index 0000000..10eb4c4 Binary files /dev/null and b/flow_ui/frontend-web-transit-flow.png differ diff --git a/flow_ui/images/extras/boat-market2transta.jpg b/flow_ui/images/extras/boat-market2transta.jpg new file mode 100644 index 0000000..74c7291 Binary files /dev/null and b/flow_ui/images/extras/boat-market2transta.jpg differ diff --git a/flow_ui/images/extras/boat.jpeg b/flow_ui/images/extras/boat.jpeg new file mode 100644 index 0000000..be57062 Binary files /dev/null and b/flow_ui/images/extras/boat.jpeg differ diff --git a/flow_ui/images/icons/minibus-256x256.ico b/flow_ui/images/icons/minibus-256x256.ico new file mode 100644 index 0000000..61443f4 Binary files /dev/null and b/flow_ui/images/icons/minibus-256x256.ico differ diff --git a/flow_ui/images/icons/minibus-512x512.png b/flow_ui/images/icons/minibus-512x512.png new file mode 100644 index 0000000..46855f2 Binary files /dev/null and b/flow_ui/images/icons/minibus-512x512.png differ diff --git a/flow_ui/images/landmarks/market.png b/flow_ui/images/landmarks/market.png new file mode 100644 index 0000000..9105698 Binary files /dev/null and b/flow_ui/images/landmarks/market.png differ diff --git a/flow_ui/images/landmarks/riverbank.jpg b/flow_ui/images/landmarks/riverbank.jpg new file mode 100644 index 0000000..ff936a4 Binary files /dev/null and b/flow_ui/images/landmarks/riverbank.jpg differ diff --git a/flow_ui/images/landmarks/temple.png b/flow_ui/images/landmarks/temple.png new file mode 100644 index 0000000..619b3b5 Binary files /dev/null and b/flow_ui/images/landmarks/temple.png differ diff --git a/flow_ui/images/landmarks/waterpark.png b/flow_ui/images/landmarks/waterpark.png new file mode 100644 index 0000000..7e7b8b2 Binary files /dev/null and b/flow_ui/images/landmarks/waterpark.png differ diff --git a/flow_ui/images/network/overview-map.png b/flow_ui/images/network/overview-map.png new file mode 100644 index 0000000..a2c9b71 Binary files /dev/null and b/flow_ui/images/network/overview-map.png differ diff --git a/flow_ui/images/partners/7-11.png b/flow_ui/images/partners/7-11.png new file mode 100644 index 0000000..19c8f15 Binary files /dev/null and b/flow_ui/images/partners/7-11.png differ diff --git a/flow_ui/images/partners/airasia-move.png b/flow_ui/images/partners/airasia-move.png new file mode 100644 index 0000000..54f0f55 Binary files /dev/null and b/flow_ui/images/partners/airasia-move.png differ diff --git a/flow_ui/images/partners/bus-pingraow.jpg b/flow_ui/images/partners/bus-pingraow.jpg new file mode 100644 index 0000000..0b87375 Binary files /dev/null and b/flow_ui/images/partners/bus-pingraow.jpg differ diff --git a/flow_ui/images/partners/busonlineticket.png b/flow_ui/images/partners/busonlineticket.png new file mode 100644 index 0000000..4e0ff2d Binary files /dev/null and b/flow_ui/images/partners/busonlineticket.png differ diff --git a/flow_ui/images/partners/lazada.png b/flow_ui/images/partners/lazada.png new file mode 100644 index 0000000..ccf1a2f Binary files /dev/null and b/flow_ui/images/partners/lazada.png differ diff --git a/flow_ui/images/partners/shopee.png b/flow_ui/images/partners/shopee.png new file mode 100644 index 0000000..0d123b9 Binary files /dev/null and b/flow_ui/images/partners/shopee.png differ diff --git a/flow_ui/images/partners/tcl999-angthong.jpg b/flow_ui/images/partners/tcl999-angthong.jpg new file mode 100644 index 0000000..e836852 Binary files /dev/null and b/flow_ui/images/partners/tcl999-angthong.jpg differ diff --git a/flow_ui/images/partners/trip.jpg b/flow_ui/images/partners/trip.jpg new file mode 100644 index 0000000..aa98af9 Binary files /dev/null and b/flow_ui/images/partners/trip.jpg differ diff --git a/flow_ui/images/partners/truck2hand.png b/flow_ui/images/partners/truck2hand.png new file mode 100644 index 0000000..dca8117 Binary files /dev/null and b/flow_ui/images/partners/truck2hand.png differ diff --git a/flow_ui/images/qrcode/101.png b/flow_ui/images/qrcode/101.png new file mode 100644 index 0000000..605ca65 Binary files /dev/null and b/flow_ui/images/qrcode/101.png differ diff --git a/flow_ui/images/qrcode/15.JPG b/flow_ui/images/qrcode/15.JPG new file mode 100644 index 0000000..5dd2984 Binary files /dev/null and b/flow_ui/images/qrcode/15.JPG differ diff --git a/flow_ui/images/qrcode/464.jpeg b/flow_ui/images/qrcode/464.jpeg new file mode 100644 index 0000000..a45f0d2 Binary files /dev/null and b/flow_ui/images/qrcode/464.jpeg differ diff --git a/flow_ui/images/qrcode/902.png b/flow_ui/images/qrcode/902.png new file mode 100644 index 0000000..7294b61 Binary files /dev/null and b/flow_ui/images/qrcode/902.png differ diff --git a/flow_ui/images/routes/101/car.jpeg b/flow_ui/images/routes/101/car.jpeg new file mode 100644 index 0000000..eaa6d8e Binary files /dev/null and b/flow_ui/images/routes/101/car.jpeg differ diff --git a/flow_ui/images/routes/101/hero.jpeg b/flow_ui/images/routes/101/hero.jpeg new file mode 100644 index 0000000..acfe305 Binary files /dev/null and b/flow_ui/images/routes/101/hero.jpeg differ diff --git a/flow_ui/images/routes/1011/car.jpeg b/flow_ui/images/routes/1011/car.jpeg new file mode 100644 index 0000000..b87cfb8 Binary files /dev/null and b/flow_ui/images/routes/1011/car.jpeg differ diff --git a/flow_ui/images/routes/1011/hero.jpeg b/flow_ui/images/routes/1011/hero.jpeg new file mode 100644 index 0000000..b87cfb8 Binary files /dev/null and b/flow_ui/images/routes/1011/hero.jpeg differ diff --git a/flow_ui/images/routes/15/car.jpg b/flow_ui/images/routes/15/car.jpg new file mode 100644 index 0000000..2083c8c Binary files /dev/null and b/flow_ui/images/routes/15/car.jpg differ diff --git a/flow_ui/images/routes/15/hero.jpg b/flow_ui/images/routes/15/hero.jpg new file mode 100644 index 0000000..08f99a9 Binary files /dev/null and b/flow_ui/images/routes/15/hero.jpg differ diff --git a/flow_ui/images/routes/2194/car.jpg b/flow_ui/images/routes/2194/car.jpg new file mode 100644 index 0000000..1e0008a Binary files /dev/null and b/flow_ui/images/routes/2194/car.jpg differ diff --git a/flow_ui/images/routes/2231/car.jpg b/flow_ui/images/routes/2231/car.jpg new file mode 100644 index 0000000..51d5fe7 Binary files /dev/null and b/flow_ui/images/routes/2231/car.jpg differ diff --git a/flow_ui/images/routes/324/car.jpg b/flow_ui/images/routes/324/car.jpg new file mode 100644 index 0000000..74e8e26 Binary files /dev/null and b/flow_ui/images/routes/324/car.jpg differ diff --git a/flow_ui/images/routes/324/hero.jpg b/flow_ui/images/routes/324/hero.jpg new file mode 100644 index 0000000..74e8e26 Binary files /dev/null and b/flow_ui/images/routes/324/hero.jpg differ diff --git a/flow_ui/images/routes/464/car.jpeg b/flow_ui/images/routes/464/car.jpeg new file mode 100644 index 0000000..7df8a0a Binary files /dev/null and b/flow_ui/images/routes/464/car.jpeg differ diff --git a/flow_ui/images/routes/641/car.jpeg b/flow_ui/images/routes/641/car.jpeg new file mode 100644 index 0000000..c33e19d Binary files /dev/null and b/flow_ui/images/routes/641/car.jpeg differ diff --git a/flow_ui/images/routes/902/car.jpg b/flow_ui/images/routes/902/car.jpg new file mode 100644 index 0000000..02ea3c9 Binary files /dev/null and b/flow_ui/images/routes/902/car.jpg differ diff --git a/flow_ui/images/routes/902/hero.jpg b/flow_ui/images/routes/902/hero.jpg new file mode 100644 index 0000000..02ea3c9 Binary files /dev/null and b/flow_ui/images/routes/902/hero.jpg differ diff --git a/flow_ui/images/routes/951/car.jpg b/flow_ui/images/routes/951/car.jpg new file mode 100644 index 0000000..b3b4e56 Binary files /dev/null and b/flow_ui/images/routes/951/car.jpg differ diff --git a/flow_ui/images/routes/952/car.jpg b/flow_ui/images/routes/952/car.jpg new file mode 100644 index 0000000..032161d Binary files /dev/null and b/flow_ui/images/routes/952/car.jpg differ diff --git a/flow_ui/images/routes/952/car.webp b/flow_ui/images/routes/952/car.webp new file mode 100644 index 0000000..d66e876 Binary files /dev/null and b/flow_ui/images/routes/952/car.webp differ diff --git a/flow_ui/images/routes/952/hero.webp b/flow_ui/images/routes/952/hero.webp new file mode 100644 index 0000000..d66e876 Binary files /dev/null and b/flow_ui/images/routes/952/hero.webp differ diff --git a/flow_ui/images/stops/36020.jpg b/flow_ui/images/stops/36020.jpg new file mode 100644 index 0000000..4248ed3 Binary files /dev/null and b/flow_ui/images/stops/36020.jpg differ diff --git a/flow_ui/images/stops/39321.jpg b/flow_ui/images/stops/39321.jpg new file mode 100644 index 0000000..3881f88 Binary files /dev/null and b/flow_ui/images/stops/39321.jpg differ diff --git a/flow_ui/images/stops/42110.jpg b/flow_ui/images/stops/42110.jpg new file mode 100644 index 0000000..82a7bb4 Binary files /dev/null and b/flow_ui/images/stops/42110.jpg differ diff --git a/flow_ui/images/stops/42250.jpg b/flow_ui/images/stops/42250.jpg new file mode 100644 index 0000000..e282daa Binary files /dev/null and b/flow_ui/images/stops/42250.jpg differ diff --git a/flow_ui/images/stops/54950.jpg b/flow_ui/images/stops/54950.jpg new file mode 100644 index 0000000..bfe68d9 Binary files /dev/null and b/flow_ui/images/stops/54950.jpg differ diff --git a/flow_ui/screenshots/busDetail.jpg b/flow_ui/screenshots/busDetail.jpg new file mode 100644 index 0000000..98bbb53 Binary files /dev/null and b/flow_ui/screenshots/busDetail.jpg differ diff --git a/flow_ui/screenshots/busDetail.png b/flow_ui/screenshots/busDetail.png new file mode 100644 index 0000000..6db8f4a Binary files /dev/null and b/flow_ui/screenshots/busDetail.png differ diff --git a/flow_ui/screenshots/busDetailExpanded.jpg b/flow_ui/screenshots/busDetailExpanded.jpg new file mode 100644 index 0000000..533e695 Binary files /dev/null and b/flow_ui/screenshots/busDetailExpanded.jpg differ diff --git a/flow_ui/screenshots/busDetailExpanded.png b/flow_ui/screenshots/busDetailExpanded.png new file mode 100644 index 0000000..f1bb53f Binary files /dev/null and b/flow_ui/screenshots/busDetailExpanded.png differ diff --git a/flow_ui/screenshots/busStop.jpg b/flow_ui/screenshots/busStop.jpg new file mode 100644 index 0000000..5e2192b Binary files /dev/null and b/flow_ui/screenshots/busStop.jpg differ diff --git a/flow_ui/screenshots/busStop.png b/flow_ui/screenshots/busStop.png new file mode 100644 index 0000000..c62997c Binary files /dev/null and b/flow_ui/screenshots/busStop.png differ diff --git a/flow_ui/screenshots/frontend-web-transit-flow.jpg b/flow_ui/screenshots/frontend-web-transit-flow.jpg new file mode 100644 index 0000000..0d37107 Binary files /dev/null and b/flow_ui/screenshots/frontend-web-transit-flow.jpg differ diff --git a/flow_ui/screenshots/index.jpg b/flow_ui/screenshots/index.jpg new file mode 100644 index 0000000..4070cec Binary files /dev/null and b/flow_ui/screenshots/index.jpg differ diff --git a/flow_ui/screenshots/index.png b/flow_ui/screenshots/index.png new file mode 100644 index 0000000..92d9ea7 Binary files /dev/null and b/flow_ui/screenshots/index.png differ diff --git a/flow_ui/screenshots/stopDetail.jpg b/flow_ui/screenshots/stopDetail.jpg new file mode 100644 index 0000000..1249f62 Binary files /dev/null and b/flow_ui/screenshots/stopDetail.jpg differ diff --git a/flow_ui/screenshots/stopDetail.png b/flow_ui/screenshots/stopDetail.png new file mode 100644 index 0000000..85a4933 Binary files /dev/null and b/flow_ui/screenshots/stopDetail.png differ diff --git a/flow_ui/screenshots/stopDetailExpanded.png b/flow_ui/screenshots/stopDetailExpanded.png new file mode 100644 index 0000000..5ed3bf2 Binary files /dev/null and b/flow_ui/screenshots/stopDetailExpanded.png differ diff --git a/flow_ui/screenshots_live/home.png b/flow_ui/screenshots_live/home.png new file mode 100644 index 0000000..4343aee Binary files /dev/null and b/flow_ui/screenshots_live/home.png differ diff --git a/flow_ui/screenshots_live/route.png b/flow_ui/screenshots_live/route.png new file mode 100644 index 0000000..251b4d1 Binary files /dev/null and b/flow_ui/screenshots_live/route.png differ diff --git a/flow_ui/screenshots_live/route_exp.png b/flow_ui/screenshots_live/route_exp.png new file mode 100644 index 0000000..a850129 Binary files /dev/null and b/flow_ui/screenshots_live/route_exp.png differ diff --git a/flow_ui/screenshots_live/routes.png b/flow_ui/screenshots_live/routes.png new file mode 100644 index 0000000..f92e4d4 Binary files /dev/null and b/flow_ui/screenshots_live/routes.png differ diff --git a/flow_ui/screenshots_live/stop.png b/flow_ui/screenshots_live/stop.png new file mode 100644 index 0000000..d6cfe9b Binary files /dev/null and b/flow_ui/screenshots_live/stop.png differ diff --git a/flow_ui/screenshots_live/stops.png b/flow_ui/screenshots_live/stops.png new file mode 100644 index 0000000..e15efdf Binary files /dev/null and b/flow_ui/screenshots_live/stops.png differ diff --git a/flow_ui/ui/_shared.css b/flow_ui/ui/_shared.css new file mode 100644 index 0000000..9d4b40c --- /dev/null +++ b/flow_ui/ui/_shared.css @@ -0,0 +1,368 @@ +/* ========================================================= + AT Transit shared polish — applied to all mockup pages + Loaded AFTER main-theme.css, BEFORE per-page + + +
+
+
+ AT Transit logo +
+

AT Transit

+

สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง

+
+
+ + ดูตารางเดินรถ +
+
+ +
+
+

หน้าแรก/ รายละเอียดสายรถ

+

101 อ่างทอง - ป่าโมก - อยุธยา

+ +
+ ภาพบรรยากาศริมทางของสาย 101 +
+ 🚌 สายระหว่างจังหวัด · 4 จุดจอดหลัก +

เส้นทางสาย 101

+

เชื่อมต่ออ่างทอง → ป่าโมก → อยุธยา ผ่านเมืองเก่าและตลาดชุมชนที่ริมแม่น้ำเจ้าพระยา

+
+
+ +
+ หมวดเส้นทางระหว่างจังหวัด + 🚌 รถบัส + 2 จังหวัด · อ่างทอง · อยุธยา + 4 จุดจอด +
+

mock state: ?route=101&origin=at_main_terminal

+ +
+ + + ← กลับหน้าแรก +
+ +
+
+

ประเภทรถ

+

รถบัสระหว่างจังหวัด

+
+
+

จังหวัดที่ผ่าน

+

อ่างทอง → อยุธยา

+
+
+

จำนวนจุดจอด

+

4 จุดหลัก

+
+
+

รอบรถถัดไป

+

09:10 น.

+
+
+ +
+
+

จุดจอดสำคัญบนเส้นทาง

+
    +
  • +
    + + 📍 ต้นทาง + + บขส.อ่างทอง + อ่างทอง + + + ⌄ + + +
    +

    ตารางเดินรถ ณ บขส.อ่างทอง

    +
    +
    07:30
    08:20
    +
    10:00
    +
    10:50
    11:50
    +
    13:00
    14:00
    +
    15:00
    +
    + +
    +
    +
  • +
  • +
    + + 🔄 จุดเปลี่ยน + + สถานีขนส่งป่าโมก + อ่างทอง + + + ⌄ + + +
    +

    ไปอ่างทอง ทิศทาง

    +
    +
    07:30
    08:20
    +
    09:10
    10:00
    +
    10:50
    11:40
    +
    12:30
    13:20
    +
    14:10
    15:00
    +
    15:50
    16:40
    +
    17:30
    18:30
    +
    +

    ไปอยุธยา ทิศทาง

    +
    +
    08:00
    08:50
    +
    09:40
    10:30
    +
    11:20
    12:20
    +
    13:30
    14:30
    +
    15:30
    +
    +

    ⚠️ เวลารถเปลี่ยนทุกวัน โดยเฉพาะวันหยุด

    + +
    +
    +
  • +
  • +
    + + 📍 ผ่านทาง + + จุดขึ้นลงรถสองแถว 101 อยุธยา-ป่าโมก-อ่างทอง + อยุธยา + + + ⌄ + + +
    +

    ยังไม่มีข้อมูลตารางอัปเดต

    + +
    +
    +
  • +
  • +
    + + 📍 ปลายทาง + + ตลาดเจ้าพรหม + อยุธยา + + + ⌄ + + +
    +

    ตารางเดินรถ ณ ตลาดเจ้าพรหม (อยุธยา)

    +
    +
    06:30
    07:20
    +
    08:10
    +
    09:50
    10:40
    +
    11:30
    12:20
    +
    13:10
    14:00
    +
    14:50
    15:40
    +
    16:30
    17:30
    +
    + +
    +
    +
  • +
+
+ + +
+
+
+ + + + diff --git a/flow_ui/ui/busDetailExpanded.html b/flow_ui/ui/busDetailExpanded.html new file mode 100644 index 0000000..9da7f09 --- /dev/null +++ b/flow_ui/ui/busDetailExpanded.html @@ -0,0 +1,322 @@ + + + + + รายละเอียดสายรถ (ขยายข้อมูล) | AT Transit (mockup) + + + + + + + +
+
+
+ AT Transit logo +
+

AT Transit

+

สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง

+
+
+ + ดูตารางเดินรถ +
+
+ +
+
+

หน้าแรก/ รายละเอียดสายรถ

+

101 อ่างทอง - ป่าโมก - อยุธยา

+ +
+ ภาพบรรยากาศริมทางของสาย 101 +
+ 🚌 ขยายข้อมูล · 4 จุดจอดหลัก +

ตารางเวลาแบบขยายทุกจุดจอด

+

เชื่อมต่ออ่างทอง → ป่าโมก → อยุธยา · ดูตารางรถของทุกป้ายอย่างละเอียด

+
+
+ +
+ หมวดเส้นทางระหว่างจังหวัด + 🚌 รถบัส + 2 จังหวัด · อ่างทอง · อยุธยา + 4 จุดจอด +
+

mock state: ?route=101&origin=at_main_terminal&view=expanded

+ +
+ + + ← กลับหน้าแรก +
+ +
+

ติดต่อผู้ประกอบการ

+
+ 📞 +66 64 963 9025 + 🌐 ยังไม่ระบุเว็บไซต์ +
+
+ LINE QR สาย 101 +
+ ติดตามข่าวสาย 101 + สแกน QR รับข่าวสาร · เลื่อนเวลา · ไม่มีรถ + LINE Official +
+
+
+ รถของสาย 101 +
+

รถบัสประจำสาย

+

รถปรับอากาศ · ไม่สูบบุหรี่ · 40 ที่นั่ง
ออกรอบละ 24 เที่ยว · ช่วง 04:30-21:00

+
+
+
+ +
+

จุดจอดสำคัญบนเส้นทาง

+
    +
  • +
    + + 📍 ต้นทาง + + บขส.อ่างทอง + อ่างทอง + + + ⌄ + + +
    + บขส.อ่างทอง +

    ตารางเดินรถ ณ บขส.อ่างทอง

    +
    +
    07:30
    08:20
    +
    10:00
    +
    10:50
    11:50
    +
    13:00
    14:00
    +
    15:00
    +
    + +
    +
    +
  • +
  • +
    + + 🔄 จุดเปลี่ยน + + สถานีขนส่งป่าโมก + อ่างทอง + + + ⌄ + + +
    + สถานีขนส่งป่าโมก +

    ไปอ่างทอง ทิศทาง

    +
    +
    07:30
    08:20
    +
    09:10
    10:00
    +
    10:50
    11:40
    +
    12:30
    13:20
    +
    14:10
    15:00
    +
    15:50
    16:40
    +
    17:30
    18:30
    +
    +

    ไปอยุธยา ทิศทาง

    +
    +
    08:00
    08:50
    +
    09:40
    10:30
    +
    11:20
    12:20
    +
    13:30
    14:30
    +
    15:30
    +
    +

    ⚠️ เวลารถเปลี่ยนทุกวัน โดยเฉพาะวันหยุด

    + +
    +
    +
  • +
  • +
    + + 📍 ผ่านทาง + + จุดขึ้นลงรถสองแถว 101 อยุธยา-ป่าโมก-อ่างทอง + อยุธยา + + + ⌄ + + +
    + จุดขึ้นลงรถสองแถว +

    ยังไม่มีข้อมูลตารางอัปเดต

    + +
    +
    +
  • +
  • +
    + + 📍 ปลายทาง + + ตลาดเจ้าพรหม + อยุธยา + + + ⌄ + + +
    + ตลาดเจ้าพรหม อยุธยา +

    ตารางเดินรถ ณ ตลาดเจ้าพรหม (อยุธยา)

    +
    +
    06:30
    07:20
    +
    08:10
    +
    09:50
    10:40
    +
    11:30
    12:20
    +
    13:10
    14:00
    +
    14:50
    15:40
    +
    16:30
    17:30
    +
    + +
    +
    +
  • +
+
+ +
+

เลือกสายรถอื่น

+ +
+
+
+ + + + diff --git a/flow_ui/ui/busStop.html b/flow_ui/ui/busStop.html new file mode 100644 index 0000000..45cdf85 --- /dev/null +++ b/flow_ui/ui/busStop.html @@ -0,0 +1,407 @@ + + + + + ป้ายหยุดรถ | AT Transit (mockup) + + + + + + + +
+
+
+ AT Transit logo +
+

AT Transit

+

สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง

+
+
+ + ดูตารางเวลา +
+
+ +
+
+

หน้าแรก/ ป้ายหยุดรถ

+
+
+

ค้นหาป้ายหยุดรถแบบรวดเร็วและอ่านง่าย

+

รวมสถานีขนส่งหลัก จุดจอดท้องถิ่น สถานีรถตู้ และจุดเอกชนในโทน soft gradient ที่ดูสะอาดตา ใช้งานได้ทั้งบนมือถือและเดสก์ท็อป

+
+
+

จำนวนจุดทั้งหมด

+

19 จุด

+
+
+

ครอบคลุม

+

9 จังหวัด

+
+
+

ประเภทหลัก

+

4 กลุ่มป้าย

+
+
+

เที่ยวใช้งานบ่อย

+

สาย 101

+
+
+
+
+

แผนที่ย่อของเครือข่ายป้าย

+ แผนที่เครือข่ายป้าย AT Transit +
+
+ +
+ + + + ย้อนกลับ +
+ + + +
    +
  • สถานีขนส่งหลัก

    บขส.อ่างทอง

    เมืองอ่างทอง · อ่างทอง

    8 สาย
    สายหลักเปิดบริการ

    ศูนย์กลางเส้นทางหลักของจังหวัด

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    สถานีขนส่งป่าโมก

    ป่าโมก · อ่างทอง

    2 สาย
    จุดต่อรถHub ย่อย

    เหมาะสำหรับต่อรถไปอยุธยา

    ดูรายละเอียด
  • +
  • จุดจอดท้องถิ่น

    จุดขึ้นลงรถสองแถว 101 อยุธยา-ป่าโมก-อ่างทอง

    พระนครศรีอยุธยา · อยุธยา

    1 สาย
    สาย 101ผ่านทาง

    จุดขึ้นลงในเส้นทางที่ใช้งานบ่อย

    ดูรายละเอียด
  • +
  • ตลาด

    ตลาดเจ้าพรหม

    พระนครศรีอยุธยา · อยุธยา

    3 สาย
    คึกคักชุมชน

    มีรถผ่านหลายช่วงเวลา

    ดูรายละเอียด
  • +
  • สถานีรถตู้

    ท่ารถตู้ต่างจังหวัด รังสิต

    รังสิต · ปทุมธานี

    5 สาย
    รถตู้ศูนย์ต่อรถ

    เชื่อมกรุงเทพกับจังหวัดรอบนอก

    ดูรายละเอียด
  • +
  • สถานีรถตู้

    สถานีเดินรถโดยสารขนาดเล็ก (จตุจักร) รถตู้/มินิบัส

    จตุจักร · กรุงเทพมหานคร

    5 สาย
    มินิบัสเมืองใหญ่

    ศูนย์รวมรถตู้ในโซนกรุงเทพฯ

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    บขส.ลพบุรี

    เมืองลพบุรี · ลพบุรี

    1 สาย
    ทางผ่านภูมิภาค

    จุดเชื่อมเส้นทางภาคกลางตอนบน

    ดูรายละเอียด
  • +
  • จุดจอดท้องถิ่น

    จุดขึ้นรถประจำทางอื่นๆ

    — · —

    7 สาย
    พื้นที่ยืดหยุ่นกระจายตัว

    จุดรองรับการเดินทางภายในท้องถิ่น

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    บขส.สุพรรณบุรี

    เมืองสุพรรณบุรี · สุพรรณบุรี

    2 สาย
    สายเชื่อมเมืองรอง

    โทนแสงนุ่ม เหมาะกับการต่อรถ

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    บขส.สระบุรี

    เมืองสระบุรี · สระบุรี

    1 สาย
    จุดหลักทางผ่าน

    เหมาะสำหรับเส้นทางเชื่อมจังหวัดถัดไป

    ดูรายละเอียด
  • +
  • จุดเอกชน

    นะโมซุปเปอร์มาร์ท

    วิเศษชัยชาญ · อ่างทอง

    1 สาย
    เอกชนจุดขาย

    เป็นจุดจอดย่อยของพื้นที่ชุมชน

    ดูรายละเอียด
  • +
  • สถานีรถตู้

    สายใต้เก่า ปิ่นเกล้า จุดจอดรถตู้

    บางกอกน้อย · กรุงเทพมหานคร

    1 สาย
    รถตู้กทม.

    โทนสีอุ่นสำหรับรถตู้และมินิบัส

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    บขส.ชัยนาท

    เมืองชัยนาท · ชัยนาท

    1 สาย
    ภาคกลางต้นทาง-ปลายทาง

    เชื่อมเส้นทางหลักของจังหวัด

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    บขส.999 อ่างทอง สายเอเชีย-เหนือ (ไม่เข้าเมือง)

    เมืองอ่างทอง · อ่างทอง

    1 สาย
    ทางด่วนนอกเมือง

    จุดสำหรับสายวิ่งนอกตัวเมือง

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    สถานีขนส่งไชโย

    ไชโย · อ่างทอง

    เร็วๆ นี้
    coming soonplaceholder

    กำลังเตรียมข้อมูลสำหรับแสดงผล

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    สถานีขนส่งโพธิ์ทอง

    โพธิ์ทอง · อ่างทอง

    เร็วๆ นี้
    coming soonplaceholder

    ข้อมูลพร้อมต่อยอดในรอบถัดไป

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    สถานีขนส่งแสวงหา

    แสวงหา · อ่างทอง

    เร็วๆ นี้
    coming soonplaceholder

    เตรียมโครงสำหรับรองรับจังหวัดย่อย

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    สถานีขนส่งวิเศษชัยชาญ

    วิเศษชัยชาญ · อ่างทอง

    เร็วๆ นี้
    coming soonplaceholder

    คิวแผนที่และเวลารถกำลังรอข้อมูล

    ดูรายละเอียด
  • +
  • สถานีขนส่งหลัก

    สถานีขนส่งสามโก้

    สามโก้ · อ่างทอง

    เร็วๆ นี้
    coming soonplaceholder

    โครงหน้าเตรียมรองรับข้อมูลในอนาคต

    ดูรายละเอียด
  • +
+
+
+ + + + diff --git a/flow_ui/ui/index.html b/flow_ui/ui/index.html new file mode 100644 index 0000000..519852d --- /dev/null +++ b/flow_ui/ui/index.html @@ -0,0 +1,387 @@ + + + + + หน้าแรก | AT Transit (mockup) + + + + + + + +
+
+
+ AT Transit logo +
+

AT Transit

+

สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง

+
+
+ + เช็กเวลาเดินรถ +
+
+ +
+ +
+
+
+
+ ✨ ยินดีต้อนรับ +

สถานีขนส่งผู้โดยสารภายใน
จังหวัดอ่างทอง

+
+ 📍 + + ▾ +
+ +
+
+ +
+
+ + +
+
+ หมวดเส้นทางเข้ากรุงเทพฯ +

เส้นทางเชื่อมต่อกรุงเทพมหานคร · 6 เส้นทาง

+
+ +
+ + +
+
+ หมวดเส้นทางระหว่างจังหวัด +

เส้นทางเชื่อมต่อจังหวัดใกล้เคียง · 4 เส้นทาง

+
+ +
+ + +
+
+ หมวดเส้นทางภายในจังหวัด +

เส้นทางภายในจังหวัดอ่างทอง · 4 เส้นทาง

+
+ +
+ +
+
+ +
+
+

14

เส้นทางทั้งหมด

+

4

หมวดเส้นทาง

+

19

สถานี/ป้ายหยุด

+

9

จังหวัดที่ครอบคลุม

+
+
+ + + + diff --git a/flow_ui/ui/stopDetail.html b/flow_ui/ui/stopDetail.html new file mode 100644 index 0000000..b853a90 --- /dev/null +++ b/flow_ui/ui/stopDetail.html @@ -0,0 +1,863 @@ + + + + + รายละเอียดป้าย | AT Transit (mockup) + + + + + + + +
+
+
+ AT Transit logo +
+

AT Transit

+

สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง

+
+
+ + ดูตารางเวลา +
+
+ +
+
+

หน้าแรก/ ป้ายหยุดรถ/ บขส.อ่างทอง

+
+
+

📍 บขส.อ่างทอง

+

ศูนย์รวมรถโดยสารหลักของจังหวัดอ่างทอง พร้อมข้อมูลเวลารถแบบอ่านง่ายและหาเที่ยวถัดไปได้ทันที

+
+ สถานีขนส่งหลัก + รหัส: at_main_terminal + เมืองอ่างทอง · จังหวัดอ่างทอง +
+
+
+

จำนวนสายรถ

+

8 สายหลัก

+
+
+

เวลาบริการ

+

04:30 - 21:00

+
+
+

เที่ยวเร็วสุดถัดไป

+

คำนวณอัตโนมัติ

+
+
+

สิ่งอำนวยความสะดวก

+

ห้องน้ำ · ที่พักคอย · ร้านอาหาร

+
+
+
+
+ ผังป้าย บขส.อ่างทอง +
+
+

เวลาปัจจุบัน ณ ป้ายนี้

+

--:--

+
+

กำลังคำนวณเที่ยวถัดไปอัตโนมัติ

+
+
+
+ +
+

ใกล้เคียงป้าย

+

สถานที่น่าสนใจและจุดแวะระหว่างรอรถได้สะดวก · เดินถึงได้ภายใน 5–10 นาที

+
+
ริมแม่น้ำเจ้าพระยา

ริมแม่น้ำเจ้าพระยาจุดพักผ่อน · เดิน 6 นาที

+
สวนน้ำอ่างทอง

สวนน้ำอ่างทองสวนสนุก · เดิน 8 นาที

+
วัดใกล้สถานี

วัดสำคัญใกล้ป้ายจุดแวะสักการะ · เดิน 5 นาที

+
ตลาดใกล้สถานี

ตลาดชุมชนอาหาร · ติดป้าย

+
+ + +
+
+

จำนวนสายรถ

+

8 สาย

+
+
+

เวลาบริการ

+

04:30 - 21:00

+
+
+

ประเภท

+

สถานีหลัก

+
+
+

สิ่งอำนวยความสะดวก

+

ครบครัน

+
+
+ +
+
+

สายรถที่ผ่านจุดนี้

+
+ + แสดง 8 จาก 8 สาย +
+
    +
  • +
    + + 902 + 🚌 รถบัส + + กรุงเทพ-อ่างทอง สายเอเซีย + เที่ยวกลับเข้า บขส.อ่างทอง + + + 18 รอบ/วัน + ⌄ + + +
    +
    +
    04:00
    04:30
    +
    05:00
    05:30
    +
    06:00
    06:30
    +
    07:00
    07:30
    +
    08:00
    08:30
    +
    09:00
    09:30
    +
    10:00
    10:30
    +
    11:00
    11:30
    +
    12:00
    12:30
    +
    13:00
    13:30
    +
    14:00
    14:30
    +
    15:00
    15:30
    +
    16:00
    16:30
    +
    17:00
    17:30
    +
    +
    +
    +
  • +
  • +
    + + 15 + 🚌 รถบัส + + กรุงเทพ-อ่างทอง สายใน + เที่ยวกลับเข้า บขส.อ่างทอง + + + 4 รอบ/วัน + ⌄ + + +
    +
    +
    05:00
    05:45
    +
    06:30
    07:30
    +
    +
    +
    +
  • +
  • +
    + + 101 + 🚌 รถบัส + + อ่างทอง-ป่าโมก-อยุธยา + เที่ยวออกจาก บขส.อ่างทอง + + + 9 รอบ/วัน + ⌄ + + +
    +
    +
    08:20
    +
    09:10
    10:00
    +
    10:50
    11:50
    +
    13:00
    14:00
    +
    15:00
    +
    +

    flow mock: เปิด route detail ที่ ?route=101&origin=at_main_terminal

    + +
    +
    +
  • +
  • +
    + + 464 + 🚌 รถบัส + + สุพรรณ-อ่างทอง-สระบุรี + เที่ยวผ่านจุดนี้ + + + 20 รอบ/วัน + ⌄ + + +
    +
    +
    06:30
    07:10
    +
    07:50
    08:40
    +
    09:30
    10:10
    +
    10:50
    11:30
    +
    12:10
    12:50
    +
    13:30
    14:10
    +
    14:50
    15:30
    +
    16:10
    16:50
    +
    17:30
    18:10
    +
    18:50
    19:30
    +
    +

    ⚠️ เวลารถเปลี่ยนทุกวัน

    +
    +
    +
  • +
  • +
    + + 641 + 🚌 รถบัส + + อ่างทอง-บ้านแพรก-ลพบุรี + เที่ยวออกจาก บขส.อ่างทอง + + + 9 รอบ/วัน + ⌄ + + +
    +
    +
    07:00
    08:00
    +
    09:00
    10:00
    +
    11:00
    12:00
    +
    13:30
    14:30
    +
    16:30
    +
    +
    +
    +
  • +
  • +
    + + 324 + 🚌 รถบัส + + อ่างทอง-วัดพิกุลทอง + เที่ยวผ่านจุดนี้ + + + 1 รอบ/วัน + ⌄ + + +
    +
    +
    10:00
    +
    +
    +
    +
  • +
  • +
    + + 1011 + 🚌 รถบัส + + อ่างทอง-สีบัวทอง + เที่ยวผ่านจุดนี้ + + + 3 รอบ/วัน + ⌄ + + +
    +
    +
    12:00
    16:00
    +
    17:00
    +
    +
    +
    +
  • +
  • +
    + + 2231 + 🚌 รถบัส + + อ่างทอง-มหานาม + เที่ยวผ่านจุดนี้ + + + 1 รอบ/วัน + ⌄ + + +
    +
    +
    16:00
    +
    +
    +
    +
  • +
+
+ + +
+
+
+ + + + + diff --git a/maintheme.png b/maintheme.png new file mode 100644 index 0000000..d3c4c75 Binary files /dev/null and b/maintheme.png differ diff --git a/ui-flow.png b/ui-flow.png new file mode 100644 index 0000000..1b69ffb Binary files /dev/null and b/ui-flow.png differ