-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate ApexCharts chart mechanism. * Remove custom plugin
- Loading branch information
Showing
6 changed files
with
291 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<footer class="site-footer h-card"> | ||
<data class="u-url" href="{{ "/" | relative_url }}"></data> | ||
|
||
<div class="wrapper"> | ||
|
||
<div class="footer-col-wrapper"> | ||
<div class="footer-col"> | ||
<p class="feed-subscribe"> | ||
<a href="{{ site.feed.path | default: 'feed.xml' | absolute_url }}"> | ||
<svg class="svg-icon orange"> | ||
<use xlink:href="{{ 'assets/minima-social-icons.svg#rss' | relative_url }}"></use> | ||
</svg><span>Subscribe</span> | ||
</a> | ||
</p> | ||
{%- if site.author %} | ||
<ul class="contact-list"> | ||
{% if site.author.name -%} | ||
<li class="p-name">{{ site.author.name | escape }}</li> | ||
{% endif -%} | ||
{% if site.author.email -%} | ||
<li><a class="u-email" href="mailto:{{ site.author.email }}">{{ site.author.email }}</a></li> | ||
{%- endif %} | ||
</ul> | ||
{%- endif %} | ||
</div> | ||
<div class="footer-col"> | ||
<p>{{ site.description | escape }}</p> | ||
</div> | ||
</div> | ||
|
||
<div class="social-links"> | ||
{%- include social.html -%} | ||
</div> | ||
|
||
</div> | ||
|
||
</footer> | ||
|
||
{% if page.apexcharts %} | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script> | ||
<script> | ||
window.addEventListener('load', function() { | ||
const elements = document.querySelectorAll('.language-apexchart'); | ||
|
||
elements.forEach(function(element) { | ||
|
||
let options; | ||
|
||
try { | ||
options = JSON.parse(element.textContent) | ||
} catch (e) { | ||
options = new Function("return " + element.textContent)() | ||
} | ||
|
||
// the highlight elements renders to pre -> code | ||
// we navigate to the parent of that | ||
const preElement = element.parentElement | ||
const parent = preElement.parentElement | ||
|
||
// Create a new div element | ||
const newDiv = document.createElement('div'); | ||
|
||
// Optionally, you can set a class or ID to the new div | ||
newDiv.classList.add('new-chart-container'); | ||
|
||
// Replace the original element tree with the new div | ||
parent.replaceChild(newDiv, preElement); | ||
|
||
const chart = new ApexCharts(newDiv, options); | ||
chart.render(); | ||
}); | ||
}); | ||
</script> | ||
|
||
{% endif %} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"chart": { | ||
"type": "line" | ||
}, | ||
"series": [{ | ||
"name": "sales", | ||
"data": [30,40,35,50,49,60,70,91,125] | ||
}], | ||
"xaxis": { | ||
"categories": [1991,1992,1993,1994,1995,1996,1997, 1998,1999] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.