class DefaultScaler implements Scaler {

    private float sizeMinimum;
    private float sizeMaximum;
    private float weightMinimum;
    private float weightMaximum;
    private float octreeLimit;

    private void setDefaults() {
        sizeMaximum = 100f;
        sizeMinimum = 4f;
        weightMinimum = 0.4f;
        weightMaximum = 2f;
        octreeLimit = 5000;
    }

    @Override
    public void doScale(Container container) {<FILL_FUNCTION_BODY>}
}

        setDefaults();

        float sizeMin = Float.POSITIVE_INFINITY;
        float sizeMax = Float.NEGATIVE_INFINITY;
        float xMin = Float.POSITIVE_INFINITY;
        float xMax = Float.NEGATIVE_INFINITY;
        float yMin = Float.POSITIVE_INFINITY;
        float yMax = Float.NEGATIVE_INFINITY;
        float zMin = Float.POSITIVE_INFINITY;
        float zMax = Float.NEGATIVE_INFINITY;
        float sizeRatio = 0f;
        float averageSize = 2.5f;

        //Recenter
        double centroidX = 0;
        double centroidY = 0;
        int nodeSize = 0;
        for (NodeDraft node : container.getUnloader().getNodes()) {
            centroidX += node.getX();
            centroidY += node.getY();
            nodeSize++;
        }
        centroidX /= nodeSize;
        centroidY /= nodeSize;
        for (NodeDraft node : container.getUnloader().getNodes()) {
            node.setX((float) (node.getX() - centroidX));
            node.setY((float) (node.getY() - centroidY));
        }

        //Measure
        for (NodeDraft node : container.getUnloader().getNodes()) {
            sizeMin = Math.min(node.getSize(), sizeMin);
            sizeMax = Math.max(node.getSize(), sizeMax);
            xMin = Math.min(node.getX(), xMin);
            xMax = Math.max(node.getX(), xMax);
            yMin = Math.min(node.getY(), yMin);
            yMax = Math.max(node.getY(), yMax);
            zMin = Math.min(node.getZ(), zMin);
            zMax = Math.max(node.getZ(), zMax);
        }

        if (sizeMin != 0 && sizeMax != 0) {

            if (sizeMin == sizeMax) {
                sizeRatio = sizeMinimum / sizeMin;
            } else {
                sizeRatio = (sizeMaximum - sizeMinimum) / (sizeMax - sizeMin);
            }

            //Watch octree limit
            if (xMin * sizeRatio < -octreeLimit) {
                sizeRatio = Math.abs(octreeLimit / xMin);
            }
            if (xMax * sizeRatio > octreeLimit) {
                sizeRatio = Math.abs(octreeLimit / xMax);
            }
            if (yMin * sizeRatio < -octreeLimit) {
                sizeRatio = Math.abs(octreeLimit / yMin);
            }
            if (yMax * sizeRatio > octreeLimit) {
                sizeRatio = Math.abs(octreeLimit / yMax);
            }
            if (zMin * sizeRatio < -octreeLimit) {
                sizeRatio = Math.abs(octreeLimit / zMin);
            }
            if (zMax * sizeRatio > octreeLimit) {
                sizeRatio = Math.abs(octreeLimit / zMax);
            }

            averageSize = 0f;

            //Scale node size
            for (NodeDraft node : container.getUnloader().getNodes()) {
                float size = (node.getSize() - sizeMin) * sizeRatio + sizeMinimum;
                node.setSize(size);
                node.setX(node.getX() * sizeRatio);
                node.setY(node.getY() * sizeRatio);
                node.setZ(node.getZ() * sizeRatio);
                averageSize += size;
            }
            averageSize /= nodeSize;
        }
        /*
         float weightMin = Float.POSITIVE_INFINITY;
         float weightMax = Float.NEGATIVE_INFINITY;
         float weightRatio = 0f;

         //Measure
         weightMaximum = averageSize * 0.8f;
         for (EdgeDraftGetter edge : container.getUnloader().getEdges()) {
         weightMin = Math.min(edge.getWeight(), weightMin);
         weightMax = Math.max(edge.getWeight(), weightMax);
         }
         if (weightMin == weightMax) {
         weightRatio = weightMinimum / weightMin;
         } else {
         weightRatio = Math.abs((weightMaximum - weightMinimum) / (weightMax - weightMin));
         }

         //Scale edge weight
         for (EdgeDraftGetter edge : container.getUnloader().getEdges()) {
         float weight = (edge.getWeight() - weightMin) * weightRatio + weightMinimum;
         assert !Float.isNaN(weight);
         edge.setWeight(weight);
         }*/
    
<no_super_class>