|
3 | 3 | import matplotlib.patches as patches
|
4 | 4 |
|
5 | 5 | meta_to_query_compat = [
|
6 |
| - # upto meta version(exclusive) : compatible query version(left open, right closed) |
| 6 | + # upto meta version(exclusive) : compatible query version [from, to) (left closed, right open) |
7 | 7 |
|
8 | 8 | "0.0.0 0.0.0 0.0.0 ",
|
9 | 9 | "0.8.30 0.0.0 0.0.0 ",
|
|
15 | 15 | "1.2.258 0.9.41 1.2.361 ",
|
16 | 16 | "1.2.663 0.9.41 1.2.726 ",
|
17 | 17 | "1.2.677 1.2.287 1.2.726 ",
|
18 |
| - "1.2.755 1.2.676 ∞ ", |
19 |
| - "1.2.756 1.2.676 ∞ ", |
20 |
| - "1.2.764 1.2.676 ∞ ", |
| 18 | + "1.2.755 1.2.676 1.2.821 ", |
| 19 | + "1.2.756 1.2.676 1.2.821 ", |
| 20 | + "1.2.764 1.2.676 1.2.821 ", |
| 21 | + "1.2.768 1.2.676 1.2.821 ", |
21 | 22 | "∞ 1.2.676 ∞ ",
|
22 | 23 | ]
|
23 | 24 |
|
@@ -59,23 +60,26 @@ def version_key(v):
|
59 | 60 | # Create compatibility rectangles
|
60 | 61 | for i, (meta, q_from, q_to) in enumerate(ranges):
|
61 | 62 | # Get positions
|
62 |
| - meta_x = meta_pos[meta] |
| 63 | + meta_end_x = meta_pos[meta] # This is the exclusive upper bound |
63 | 64 | q_from_y = query_pos[q_from]
|
64 | 65 | q_to_y = query_pos[q_to]
|
65 | 66 |
|
66 |
| - # Determine the width of the rectangle (next meta version - current) |
67 |
| - next_meta_idx = sorted_meta_versions.index(meta) + 1 |
68 |
| - if next_meta_idx < len(sorted_meta_versions): |
69 |
| - width = meta_pos[sorted_meta_versions[next_meta_idx]] - meta_x |
| 67 | + # Determine the start position (previous meta version or 0) |
| 68 | + meta_idx = sorted_meta_versions.index(meta) |
| 69 | + if meta_idx > 0: |
| 70 | + meta_start_x = meta_pos[sorted_meta_versions[meta_idx - 1]] |
70 | 71 | else:
|
71 |
| - width = 1.0 # Width for the last range |
| 72 | + meta_start_x = -0.5 # Start from beginning for first range |
72 | 73 |
|
73 |
| - # Height of the rectangle |
| 74 | + # Width of the rectangle (up to but not including current meta version) |
| 75 | + width = meta_end_x - meta_start_x |
| 76 | + |
| 77 | + # Height of the rectangle ([from, to) range - covers q_from_y to just before q_to_y) |
74 | 78 | height = q_to_y - q_from_y
|
75 | 79 |
|
76 | 80 | # Create rectangle patch
|
77 | 81 | rect = patches.Rectangle(
|
78 |
| - (meta_x, q_from_y), |
| 82 | + (meta_start_x, q_from_y), |
79 | 83 | width,
|
80 | 84 | height,
|
81 | 85 | linewidth=1,
|
|
0 commit comments