feat: 采样点透明度范围可在图层行设置

This commit is contained in:
nixevol
2026-10-16 09:48:20 +08:00
parent 5ef514bdbc
commit fb6df9e602
6 changed files with 74 additions and 13 deletions
+6
View File
@@ -33,6 +33,12 @@ class SampleOpacityTests(unittest.TestCase):
def test_single_total_is_the_darkest(self):
self.assertEqual(opacity_by_total([4, 4]), {4: 70})
def test_custom_range_keeps_the_ends(self):
mapping = opacity_by_total([1, 3, 9], 20, 80)
self.assertEqual(mapping[1], 20)
self.assertEqual(mapping[9], 80)
self.assertEqual(mapping[3], 50)
def test_style_is_solid_red_using_opacity_percent(self):
qml = (Path(__file__).resolve().parents[1] / "marketgrid" / "styles" / "sample_points.qml").read_text(encoding="utf-8")
self.assertIn('value="solid"', qml)