2013-09-21 11:35:18 -04:00
|
|
|
<?php
|
2026-03-26 12:46:27 -04:00
|
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2013-09-21 11:35:18 -04:00
|
|
|
|
|
|
|
|
namespace Icinga\Chart\Primitive;
|
|
|
|
|
|
2014-07-09 12:04:03 -04:00
|
|
|
use DOMElement;
|
|
|
|
|
use Icinga\Chart\Render\RenderContext;
|
2013-09-21 11:35:18 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Wrapper for raw elements to be added as Drawable's
|
|
|
|
|
*/
|
|
|
|
|
class RawElement implements Drawable
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The DOMElement wrapped by this Drawable
|
|
|
|
|
*
|
|
|
|
|
* @var DOMElement
|
|
|
|
|
*/
|
|
|
|
|
private $domEl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create this RawElement
|
|
|
|
|
*
|
|
|
|
|
* @param DOMElement $el The element to wrap here
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(DOMElement $el)
|
|
|
|
|
{
|
|
|
|
|
$this->domEl = $el;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create the SVG representation from this Drawable
|
|
|
|
|
*
|
2013-09-25 10:32:28 -04:00
|
|
|
* @param RenderContext $ctx The context to use for rendering
|
2013-09-21 11:35:18 -04:00
|
|
|
*
|
2013-09-25 10:32:28 -04:00
|
|
|
* @return DOMElement The SVG Element
|
2013-09-21 11:35:18 -04:00
|
|
|
*/
|
|
|
|
|
public function toSvg(RenderContext $ctx)
|
|
|
|
|
{
|
|
|
|
|
return $this->domEl;
|
|
|
|
|
}
|
|
|
|
|
}
|