class DynamicRangeFilter implements ComplexFilter {

        private final TimeRepresentation timeRepresentation;
        private FilterProperty[] filterProperties;
        private Interval visibleInterval;
        private Range range = new Range(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
        private boolean keepNull = true;

        public DynamicRangeFilter(GraphModel graphModel) {
            this.timeRepresentation = graphModel.getConfiguration().getTimeRepresentation();
        }

        @Override
        public Graph filter(Graph graph) {<FILL_FUNCTION_BODY>}

        private boolean evaluateElement(Element element) {
            if (timeRepresentation.equals(TimeRepresentation.INTERVAL)) {
                IntervalSet timeSet = (IntervalSet) element.getAttribute("timeset");
                if (timeSet != null) {
                    for (Interval i : timeSet.toArray()) {
                        if (visibleInterval.compareTo(i) == 0) {
                            return true;
                        }
                    }
                } else return keepNull;
            } else {
                TimestampSet timeSet = (TimestampSet) element.getAttribute("timeset");
                if (timeSet != null) {
                    for (double t : timeSet.toPrimitiveArray()) {
                        if (visibleInterval.compareTo(t) == 0) {
                            return true;
                        }
                    }
                } else return keepNull;
            }
            return false;
        }

        @Override
        public String getName() {
            return NbBundle.getMessage(DynamicRangeBuilder.class, "DynamicRangeBuilder.name");
        }

        @Override
        public FilterProperty[] getProperties() {
            if (filterProperties == null) {
                filterProperties = new FilterProperty[0];
                try {
                    filterProperties = new FilterProperty[] {
                        FilterProperty.createProperty(this, Range.class, "range"),
                        FilterProperty.createProperty(this, Boolean.class, "keepNull")};
                } catch (Exception ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
            return filterProperties;
        }

        public FilterProperty getRangeProperty() {
            return getProperties()[0];
        }

        public boolean isKeepNull() {
            return keepNull;
        }

        public void setKeepNull(boolean keepNull) {
            this.keepNull = keepNull;
        }

        public Range getRange() {
            return range;
        }

        public void setRange(Range range) {
            this.range = range;
        }

        public void destroy() {
        }
    }

            visibleInterval = new Interval(range.getLowerDouble(), range.getUpperDouble());

            List<Node> toRemoveNodes = new ArrayList<>();
            for (Node n : graph.getNodes()) {
                if (!evaluateElement(n)) {
                    toRemoveNodes.add(n);
                }
            }
            graph.removeAllNodes(toRemoveNodes);

            List<Edge> toRemoveEdge = new ArrayList<>();
            for (Edge e : graph.getEdges()) {
                if (!evaluateElement(e)) {
                    toRemoveEdge.add(e);
                }
            }
            graph.removeAllEdges(toRemoveEdge);

            graph.getModel().setTimeInterval(graph.getView(), visibleInterval);

            return graph;
        
<no_super_class>