package HTML::D3;
use strict;
use warnings;
use JSON::MaybeXS;
use Scalar::Util;
# TODO: add animated tooltips to charts with legends
=head1 NAME
HTML::D3 - A simple Perl module for generating ch
t be an array of arrays' unless ref($data) eq 'ARRAY';
# Generate JSON representation of data
my $json_data = encode_json([
map { { label => $_->[0], value => $_->[1] } } @$data
]);
th}" height="$self->{height}" style="border: 1px solid black;"></svg>
<script>
const data = $json_data;
const svg = d3.select("#chart");
const margin = { top: 20, right: 30, bottom: 40, left: