ethereum / glados

Portal network monitoring application.
65 stars 30 forks source link

Neater ticks on x-axis of network coverage chart #270

Closed carver closed 6 months ago

carver commented 6 months ago

My intuition to do this was to modify radius_stacked_chart() in assets/js/radiusdensity.js to use something like this x-axis setting:

    // Add X axis
    const ticks = Array(17).fill(0).map((none, index) => index * 16);
    ticks[ticks.length - 1] -= 1;
    ...
    svg.append("g")                                                               
        .attr("transform", `translate(0, ${height})`)
        .call(d3.axisBottom(x).tickValues(ticks).tickFormat(d3.format("#0x")))
        ...

Basically, I want a tick for every upper nibble, with a lower nibble of 0, plus one last 0xff.

Ooh, the multiplication was off by 2. Nevermind, it works now. Closing 😆