<commit_before>package com.bioserve.webstats.client;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.Image;


public class PlotWrapper implements Updateable, TimespanSettable {
	private DockPanel mainPanel = new DockPanel();
	private Image plotImage;
	private HttpGetWrapper imageGetWrapper = new HttpGetWrapper();
	private HTML htmlTitle = new HTML();
	
	public PlotWrapper() {
		//Set the defaults for the query.
		imageGetWrapper.setBaseUrl("http://localhost/~andrew/cgi-bin/bdmplot.py");
		setTimespan("last 30m");
		setFilter("syshealth.otis.*:Seconds-of-uptime");
	}
	
	public PlotWrapper(String packHere) {
		this();
		pack(packHere);
		setTitle("Plot");	/* Untitled */
	}
	
	public PlotWrapper(String packHere, String filter)
	{
		this();
		setFilter(filter);
		pack(packHere);
		setTitle(filter);	/* Untitled */
	}
	
	private void pack(String packHere) {
		// Draw the image once.
		update();
			
		//Pack the panel into packHere.
		RootPanel.get(packHere).add(mainPanel);
		
		//Pack the title into the panel, set attributes.
		mainPanel.add(htmlTitle, DockPanel.NORTH);
		htmlTitle.setStylePrimaryName("plotTitle");
	}
	
	public void update() {
		if(plotImage == null) {
			//Make the image and add it.
			plotImage = new Image(imageGetWrapper.toString());
			mainPanel.add(plotImage, DockPanel.CENTER);
		} else {
			//Update the image URL, which triggers a reload of the image.
			plotImage.setUrl(imageGetWrapper.toString() + 
					"&bogus=" + System.currentTimeMillis()); /* FIXME: Hack to force reload */
		}
	}
	<commit_msg>Allow null filters: plot the default in that case.<commit_after>package com.bioserve.webstats.client;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.Image;


public class PlotWrapper implements Updateable, TimespanSettable {
	private DockPanel mainPanel = new DockPanel();
	private Image plotImage;
	private HttpGetWrapper imageGetWrapper = new HttpGetWrapper();
	private HTML htmlTitle = new HTML();
	
	public PlotWrapper() {
		//Set the defaults for the query.
		imageGetWrapper.setBaseUrl("http://localhost/~andrew/cgi-bin/bdmplot.py");
		setTimespan("last 30m");
		setFilter("syshealth.otis.*:Seconds-of-uptime");
	}
	
	public PlotWrapper(String packHere) {
		this();
		pack(packHere);
		setTitle("Plot");	/* Untitled */
	}
	
	public PlotWrapper(String packHere, String filter)
	{
		this();
		if(filter != null) {
			setFilter(filter);
			pack(packHere);
			setTitle(filter);	/* Untitled */
		}
	}
	
	private void pack(String packHere) {
		// Draw the image once.
		update();
			
		//Pack the panel into packHere.
		RootPanel.get(packHere).add(mainPanel);
		
		//Pack the title into the panel, set attributes.
		mainPanel.add(htmlTitle, DockPanel.NORTH);
		htmlTitle.setStylePrimaryName("plotTitle");
	}
	
	public void update() {
		if(plotImage == null) {
			//Make the image and add it.
			plotImage = new Image(imageGetWrapper.toString());
			mainPanel.add(plotImage, DockPanel.CENTER);
		} else {
			//Update the image URL, which triggers a reload of the image.
			plotImage.setUrl(imageGetWrapper.toString() + 
					"&bogus=" + System.currentTimeMillis()); /* FIXME: Hack to force reload */
		}
	}
	
{'fraction_non_alphanumeric': 0.12973290284707953, 'fraction_numerical': 0.001174053419430584, 'mean_word_length': 4.041420118343195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7659265', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1092, 'n_words': 260}