Toggle on off items from CZML

We have a CZML that might have multiple data types.

Is there away to only show some of the values?

I’m thinking something like this on a data source.
entities.removeById

But I want to be able to turn them on and off by button click.

If I get you right. Splitting data can be done using id. This will most likely be your entityCollection. So, you can use dataSource.entities.getById ("id"). Create a button and bind an event handler, for example <button id = "btn">hide </button>
document.getElementById (‘btn’). AddEventListener (‘click’, function (event) {
dataSource.entities.getById (“id”) .show = false;
});
Didn’t check the code.

Ideally I would be able to say
“hide all items of type 'something”

However I’m unsure if I can interrogate my czml files to this level.

Ideally I’d love something like this:_
var viewer = new Cesium.Viewer(‘cesiumContainer’);

var redLine = viewer.entities.add({
    polyline : {
        positions : Cesium.Cartesian3.fromDegreesArray([-75, 35,
                                                        -125, 35]),
        width : 5,
        material : Cesium.Color.RED
    }
});

Sandcastle.addToolbarButton('Toggle Show', function() {
    redLine.show = !redLine.show;
});

viewer.zoomTo(viewer.entities);

As mentioned here:- https://groups.google.com/g/cesium-dev/c/jSUpfaLWR_c

However for the above example I’d like to say:-
in viewer.entities hide all with material : Cesium.Color.RED