Feature/events api#478
Open
mudhoney wants to merge 52 commits intoHelioviewer-Project:mainfrom
Open
Conversation
…pointer array, just use array to use copy value instead of reference
…tion timeout to php test client, makes connection url unbearable
… rotated events for all frames, only 1 requst to calculate all points
…t correct coloring for polygons per event_type
…ck objects for event_marker pngs, we create only one instance per event_type and reuse it , this prevents creating 40 imagick SS.png objects, for 40 different Sunspots or any other types,,after this improvement, there will only be one imagick instance of this event_type.png per event_type
dgarciabriseno
requested changes
Apr 28, 2026
8dc602f to
fdc7546
Compare
… also implement tests for this
# Conflicts: # src/Database/Statistics.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate event data to standalone Events API service
Summary
Replaces the in-process HEK adapter and direct DB event queries with a remote
Events API client (
events.helioviewer.org). Adds an event coverage timeline,rewrites composite-image polygon rendering from raster PNGs to vector
footprints, cleans up the module system to PSR-4, and adds ~1,500 lines of
new unit tests.
Why
The legacy event pipeline pulled HEK events from MySQL via
HEKAdapter,applied solar-rotation in PHP, and emitted pre-baked polygon PNGs at ingest
time. That model was tightly coupled to a single HEK schema, did per-frame
queries when generating movies, and could not style polygons per type.
A dedicated Events API service lets the backend issue a single batched query
for all frames and receive events with already-rotated coordinates and
vector footprints.
What changed
src/Event/Api/{EventsApi,LegacyEvents,...}with four endpoints (legacy, range, distributions, batch). Configurable
URL + timeout via new ini keys; defaults to production.
src/Event/Timeline/(Timeline,Resolution,MinuteCoverage+SwimLaner,AggregatedCoverage,TimeRange).getDataCoverageauto-routes to it wheneventLayersis present;endpoint contract preserved.
[AR,all,1],[FL,...]strings intocanonical
HEK>>Active Regionpaths.hv_poly_*PNGloading with
ImagickDraw::polygonfromevent['footprint']. Per-typefill colors from new
EVENT_COLORSconst, black stroke, matchesfrontend SVG style. Marker PNGs cached by type. Drops dead
hpc_boundccbranch,$maxPixelScale,_sortByLayeringOrder.interface.Module.php->ModuleInterface.php(PSR-4), new
AbstractModulebase class. No public dispatch case nameschanged;
&$params->$paramseverywhere.getEventsBatchcall pre-fetches all frametimestamps before frame generation.
__destructadded to close mysqlihandles. Movie layer limit raised 3 -> 5.
double-capture bug.
Configuration
New ini keys in
settings/Config.Example.ini:Existing installations pick up the defaults automatically.
Risk
match
mainfor all existing endpoints.black outlines instead of uniform yellow. Pixel-diff regressions need
rebaselining.
events.helioviewer.orgfor footprints. If unreachable, screenshotsstill render -- just no polygons. Silent degradation, not a hard fail.
HEKAdapterlegacy path: still alive forModule/SolarEvents.phpendpoints (
getEvents,getEventGlossary, etc.). Third-party clients onthose endpoints are unaffected.
Test plan
composer testpasses locallycomposer test-integrationpasses locallypolygons render with the right per-type color and the marker is positioned
over the polygon
events appear on each frame and rotation moves them correctly
getDataCoverage?eventLayers=[AR,all,1]&startDate=...&endDate=...at a minute-level range; confirm timeline JSON contains the event series
AggregatedCoveragepath returns aggregated buckets
getDataCoverage?imageLayers=[SDO,AIA,171,1,100]&startDate=...&endDate=...-- confirm image-layer path is unchanged
getEventsstill returns the legacy HEK shape (used by olderclients / JHelioviewer)