- SVG animáció-késleltetés hozzáadva

This commit is contained in:
Wiesner András 2022-06-16 21:13:18 +02:00
parent bb66a40f3f
commit 2f8b8f1cad

View File

@ -394,7 +394,7 @@ define("SVG_REPORT_PIE_RADIUS", 110);
define("SVG_REPORT_ANIMATION_DUR", 2);
// SVG-kép generálása a jelentésből
function generate_svg_plot($report, $mobile = false): string
function generate_svg_plot($report, $mobile = false, $timing = 8): string
{
$pie_orig = [SVG_REPORT_WIDTH / 2, SVG_REPORT_HEIGHT / 2];
$pie_radius = SVG_REPORT_PIE_RADIUS;
@ -542,7 +542,8 @@ function generate_svg_plot($report, $mobile = false): string
//$color = "rgb(" . random_int(0, 255) . "," . random_int(0, 255) . "," . random_int(0, 255) . ")";
$color = $palette[$idx];
$anim_delay = SVG_REPORT_ANIMATION_DUR * 2 / 3 * ($sector_count - $idx - 1);
$anim_delay = $timing * ($sector_count - $idx - 1);
//$anim_delay = SVG_REPORT_ANIMATION_DUR * 2 / 3 * ($sector_count - $idx - 1);
$svg .= "<g class='datagroup' style='animation-delay: ${anim_delay}s' id='datagroup${idx}'>";
$sector_id = "sector$idx";
$svg .= $svg_path($svg_curve($percent), $color, "$sector_id"); // körcikk
@ -856,7 +857,7 @@ if (cp_verify_id($elector_id)) {
case "cp_generate_plot":
{
$disable_jsoning = true;
$res = generate_svg_plot(generate_report(false));
$res = generate_svg_plot(generate_report(false), false, 0);
}
break;
case "cp_csv_report":